Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to include the standard input-output header.
C
#include [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong header that doesn't provide printf.
Forgetting the angle brackets around the header name.
✗ Incorrect
The <stdio.h> header is needed for input and output functions like printf.
2fill in blank
mediumComplete the code to start the main function.
C
int [1]() { Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different function name instead of main.
Omitting the parentheses after the function name.
✗ Incorrect
The main function is the entry point of a C program.
3fill in blank
hardFix the error in the printf statement to print Hello World.
C
printf([1]); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using single quotes which are for single characters.
Not using any quotes causing a syntax error.
✗ Incorrect
The string to print must be inside double quotes "" in C.
4fill in blank
hardFill the blank to correctly end the main function with a return statement.
C
return [1]; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Returning 1 which usually means an error.
Returning the function name or void which is invalid.
✗ Incorrect
Returning 0 from main means the program ended successfully.
5fill in blank
hardFill all three blanks to complete the full Hello World program.
C
#include [1] int [2]() { printf([3]); return 0; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Missing the header include.
Wrong function name or missing parentheses.
Not quoting the string in printf.
✗ Incorrect
This is the complete minimal C program that prints Hello World.