Write a c program to demonstrate sizeof operator
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("Integer takes %d bytes\n",sizeof(int));
printf("Floating-point takes %d
bytes\n",sizeof(float));
printf("Character takes %d byte\n",sizeof(char));
printf("Double takes %d bytes\n",sizeof(double));
getch();
}
Output:
Integer takes 2 bytes
Floating-point takes 4 bytes
Character takes 1 byte
Double takes 8 bytes
No comments: