-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC++ Data Types.cpp
More file actions
42 lines (31 loc) · 1.11 KB
/
C++ Data Types.cpp
File metadata and controls
42 lines (31 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
[PROGRAM] : C++ Data Types
[AUTHOR] : Saddam Arbaa
[Email] : <saddamarbaas@gmail.com> */
#include <iostream>
#include <string>
using namespace std;
// the main Function
int main ()
{
// declare Integer variable
int number = 15; // Integer (whole number)
// declare Float type variable
float floatNmber = 13.56; // Floating point number
// declare Float type variable
double myDoubleNumber = 20.58; // Floating point number
// declare Character type variable
char letter = 'A'; // Character
// declare Boolean type variable
bool boolean = false; // Boolean
// declare String type variable
string name = "my name is saddam"; // String
// Print variable values
cout << "int : " << number <<"\n";
cout << "float : " << floatNmber << "\n";
cout << "double : " << myDoubleNumber << "\n";
cout << "char : " << letter << "\n";
cout << "boolean: " << boolean << "\n";
cout << "string: " << name << "\n";
return 0;// signal to operating system everything works fine
}/** End of main function */