Script started on Mon Sep 14 17:30:47 2026 macbook:Desktop> cat q4 What is the command to compile the C program hello.c? macbook:Desktop> cd csc3320_Fall2026/programs/C_ch2 macbook:C_ch2> cat io_example.c /* hello world gcc io_example.c -o io_example */ #include int main (int argc, char *argv[]) { int n; printf("hello.\n"); // in-line comment scanf("%d", &n); printf("the number is %d\n", n); return 0; } macbook:C_ch2> gcc io_example.c -o io_example macbook:C_ch2> ./io_example hello. 9 the number is 9 macbook:C_ch2> cat io_example2.c /* hello world gcc io_example2.c -o io_example2 */ #include #define num 4 int main (int argc, char *argv[]) { int n; printf("hello. Enter a number: "); // in-line comment scanf("%d", &n); if (n < num) printf("the number is %d less than %d\n", n, num); else printf("the number is %d greater than or equal to %d\n", n, num); return 0; } macbook:C_ch2> gcc io_example2.c -o io_example2 macbook:C_ch2> ./io_example2 hello. Enter a number: 8 the number is 8 greater than or equal to 4 macbook:C_ch2> ./io_example2 hello. Enter a number: 3 the number is 3 less than 4 macbook:C_ch2> cat sizeof.c #include int main (int argc, char *argv[]) { printf("Size of a float is %d\n", sizeof(float)); return 0; } macbook:C_ch2> gcc sizeof.c -o sizeof sizeof.c:5:38: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat] 5 | printf("Size of a float is %d\n", sizeof(float)); | ~~ ^~~~~~~~~~~~~ | %lu 1 warning generated. macbook:C_ch2> cat sizeof.c #include int main (int argc, char *argv[]) { printf("Size of a float is %lu\n", sizeof(float)); return 0; } macbook:C_ch2> gcc sizeof.c -o sizeof macbook:C_ch2> ./sizeof Size of a float is 4 macbook:C_ch2> cat ~/Desktop/q5 T/F: A directive is a command to be executed when the program runs. macbook:C_ch2> exit Saving session... ...copying shared history... ...saving history...truncating history files... ...completed. Deleting expired sessions... 10 completed. Script done on Mon Sep 14 19:03:29 2026