| |
/********************************
*This program demonstrates the *
*use of the sizeOf function to *
*obtain the amount of memory *
*each type takes up *
********************************/
#include <stdio.h>
int main (void)
{
printf("char: %d\n", sizeof(char)); /*Returns and prints size of char*/
printf("int: %d\n", sizeof(int)); /*Returns and prints size of int*/
printf("long: %d\n", sizeof (long)); /*Returns and prints size of long*/
printf("float: %d\n", sizeof (float)); /*Returns and prints size of float*/
printf("double: %d\n", sizeof (double));/*Returns and prints size of double*/
return (0);
}
|