【課題1−1】

 

(プログラム例)

#include <stdio.h>

int main(void) {

         printf("size of int    = %d bytes\n", sizeof(int));

         printf("size of short  = %d bytes\n", sizeof(short));

         printf("size of long   = %d bytes\n", sizeof(long));

         printf("size of float  = %d bytes\n", sizeof(float));

         printf("size of double = %d bytes\n", sizeof(double));

         printf("size of char   = %d bytes\n", sizeof(char));

         return 0;

}

 

(実行例)

size of int    = 4 bytes

size of short  = 2 bytes

size of long   = 4 bytes

size of float  = 4 bytes

size of double = 8 bytes

size of char   = 1 bytes