-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path06.variousDatatype.cpp
More file actions
54 lines (35 loc) · 1.33 KB
/
Copy path06.variousDatatype.cpp
File metadata and controls
54 lines (35 loc) · 1.33 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
43
44
45
46
47
48
49
50
51
52
53
54
#include<iostream>
using namespace std;
int main(){
int i=10;
cout<<"value of variable i is "<<i<<endl;//10
cout<<"size of datatype int is "<<sizeof(int)<<endl;//4
cout<<sizeof(int)<<endl;
cout<<"********************************"<<endl;
short int s=25;
cout<<"value of variable s is "<<s<<endl;//25
cout<<"size of datatype short int is "<<sizeof(s)<<endl;//2
cout<<sizeof(short int)<<endl;
cout<<"********************************"<<endl;
long int l=30;
cout<<"value of variable l is "<<l<<endl;//30
cout<<"size of datatype long int is "<<sizeof(l)<<endl;//8
cout<<sizeof(long int)<<endl;
cout<<"********************************"<<endl;
float f=1.23;
cout<<"value of variable f is"<<f<<endl;
cout<<"size of datatype float int is "<<sizeof(f)<<endl;//8
cout<<sizeof(float)<<endl;
cout<<"********************************"<<endl;
double d=2.723;
cout<<"value of variable d is"<<d<<endl;
cout<<"size of double datatype is "<<sizeof(d)<<endl;
cout<<sizeof(double)<<endl;
cout<<"********************************"<<endl;
char c='a';
cout<<"value of variable c is "<<c<<endl;
cout<<"size of char datatype is "<<sizeof(c)<<endl;
cout<<sizeof(char)<<endl;
cout<<"********************************"<<endl;
return 0;
}