Print the size of double type of your machine and long variable result.

Q26. Write a statement to print the size of

  1. double type of your machine.
  2. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

67 Views
%d bloggers like this: