Recall & Review
beginner
What is the purpose of the
#include <stdio.h> line in a C program?It tells the compiler to include the Standard Input Output library, which allows the program to use functions like
printf() to display text on the screen.Click to reveal answer
beginner
What does the
int main() function represent in a C program?It is the starting point of the program where execution begins. The program runs the code inside
main() first.Click to reveal answer
beginner
Why do we use
return 0; at the end of the main() function?It tells the operating system that the program finished successfully. Returning 0 usually means no errors happened.
Click to reveal answer
beginner
What does the
printf() function do?It prints text or variables to the screen so the user can see output from the program.
Click to reveal answer
beginner
Why do we put a semicolon
; at the end of most lines in C?The semicolon tells the compiler that the statement is finished, like a full stop in a sentence.
Click to reveal answer
What is the correct way to start the main function in a C program?
✗ Incorrect
The main function in C starts with
int main() which returns an integer.Which header file is needed to use
printf()?✗ Incorrect
printf() is declared in the stdio.h header file.What does
return 0; mean in the main() function?✗ Incorrect
Returning 0 means the program finished successfully without errors.
Which symbol ends a statement in C?
✗ Incorrect
A semicolon
; ends a statement in C.What will this code print? <br>
printf("Hello, World!\n");✗ Incorrect
It prints the text Hello, World! followed by a new line.
Explain the basic structure of a simple C program that prints text on the screen.
Think about what each part does and how they work together.
You got /5 concepts.
Why is the
main() function important in every C program?Consider what happens when you run a C program.
You got /3 concepts.