Errors And Warnings

Basic syntax errors.


Type the statements. Then, correct the one syntax error in each statement. Hints: Statements end in semicolons, and string literals use double quotes.

printf("Predictions are hard.\n";
printf("Especially ');
printf("about the future.\n").
print("Num is: %d\n", userNum);
#include <stdio.h>

int main(void) {
 int userNum;

userNum = 5;

printf("Predictions are hard.\n");
printf("Especially ");
printf("about the future.\n");
printf("Num is: %d\n", userNum);

return 0;

More syntax errors.

Retype the statements, correcting the syntax errors.

printf("Num: %d\n", songnum);
   printf("%d\n", int songNum); 
   printf("%d songs\n" songNum);
#include <stdio.h>

int main(void) {
 int songNum;

songNum = 5;

printf("Num: %d\n", songNum);
printf("%d\n", songNum); 
printf("%d songs\n", songNum);

return 0;