Program demonstrating sizeof operator
sizeof() operator returns the size in bytes of the expression of the given type
It takes the datatype as argument
Program :
#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
printf("\nCharacter Consume : %d Range ",sizeof(char));
printf("\nInteger Consume : %d Bytes ",sizeof(int));
printf("\nFloat Consume : %d Bytes ",sizeof(float));
printf("\nDouble Consume : %d Bytes ",sizeof(double));
getch();
}
Output :
0 comments:
Post a Comment