Print the size of double type of your machine and long variable result.
Q26. Write a statement to print the size of
- double type of your machine.
- a long variable result.
Ans.(1).
double doubleType;
cout<<“\n Size of double: “sizeof(doubleType)<<” bytes”;
OUTPUT:
Size of double: 8 bytes
Ans.(2).
long longType;
cout<<“\n Size of long: “sizeof(longType)<<” bytes”;
OUTPUT:
Size of long: 4 bytes