Format specifier %ld
C
#include <stdio.h>
int main()
{
int integerNumber = 5;
double doubleNumber = 3.14;
float floatNumber = 3.14;
printf ("The number of bytes occupied by an \
\n int type variable is %ld\n",sizeof(int));
printf("The number of bytes occupied by the \
\n int type variable integerNumber is %ld\n\n",sizeof(integerNumber));
printf("The number of bytes occupied by a \
\n double tyoe variable is %ld\n", sizeof(double));
printf("The number of bytes occupied by the \
\n double type integerNumber is %ld\n", sizeof(doubleNumber));
printf("The number of bytes occupied by a \
\n float type variable is %ld\n", sizeof(float));
printf("The number of bytes occuiped by the \
\n flaot type variable floatNumber is %ld\n", sizeof(floatNumber));
return 0;
}
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.