Diagnostic Quiz
Problems
5. printf() behavior
printf("%.2f", 41); // This will print 0.0 and generates a warning7. scanf() and fgets()
char module_code[7];
scanf("%6s", module_code);
// or
char module_code[7];
fgets(module_code, 7, stdin);8. Output Analysis
long x;
scanf("%ld", &x);
printf("You entered %ld\n", x);
scanf("%ld", &x);
printf("You entered %ld\n", x);Last updated