AD1

Saturday, 14 January 2017

size of double data type

Write a program to calculate the size of a double data type in terms of Bytes , Do not use the sizeof() operator

Solution


#include "stdio.h"
int main()
{
double array[2]={0,0};
double *p1=array;
double *p2=p1+1;
printf("Size of double data type is %d Bytes\n",(int)p2-(int)p1);
return 0;
}
view raw sizeof.c hosted with ❤ by GitHub

No comments:

Post a Comment