-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.datatypes.cpp
52 lines (42 loc) · 1.4 KB
/
1.datatypes.cpp
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
43
44
45
46
47
48
49
50
51
52
#include <iostream>
using namespace std;
int main(){
// int a,b,x; //whole number datatype
// cout<<"enter first and second number"<<endl;
// cin>>a>>b;
// // cout<<"enter Second number"<<endl;
// // cin>>b;
// x = a*b; // C++ is case sensitive
// cout<<"The answer is "<<x<<endl;
// ---------------------------- Float Data type decimal-------------------------
// float v1, v2, v3;
// cout<<"enter first and second number"<<endl;
// cin>>v1>>v2;
// v3 =v1/v2;
// cout<<"The answer is "<<v3<<endl;
// ---------------------- Double Data type longer decimal--------------------------
// float v1, v2, v3;
// cout<<"enter first and second number"<<endl;
// cin>>v1>>v2;
// v3 =v1/v2;
// cout<<"The answer is "<<v3<<endl;
//-----other data types ---------
// string d;
// short int e;
// long int f; //longer version of ints
// unsigned int a; // stores only positive ints
// bool attend = true;
//---------------Program---------
int age;
float score;
string name;
bool student;
cout<<" enter students name"<<endl;
cin>>name;
cout<<" enter students age"<<endl;
cin>>age;
cout<<" enter students score"<<endl;
cin>>score;
cout<<" Your name is "<<name<<", your age is "<<age<<", and you have a score of "<<score<<endl;
return 0; // tells processor program is done running
}