Recall & Review
beginner
What is the basic structure of a C program?
A C program typically includes: <br>1. Preprocessor directives (like #include)<br>2. The main() function where execution starts<br>3. Declarations of variables<br>4. Statements and expressions inside main() or other functions<br>5. Return statement to end main()
Click to reveal answer
beginner
What is the role of the
#include directive in a C program?The
#include directive tells the compiler to include the contents of a file, usually a header file, before compiling. For example, #include <stdio.h> includes standard input/output functions like printf().Click to reveal answer
beginner
Why is the
main() function important in a C program?The
main() function is the starting point of a C program. When you run the program, the computer begins executing instructions from main(). Without it, the program has no entry point.Click to reveal answer
beginner
What does the
return 0; statement mean in main()?The statement
return 0; tells the operating system that the program finished successfully. Returning zero is a standard way to indicate no errors occurred.Click to reveal answer
beginner
What are variables and where are they declared in a C program?
Variables are names that store data values. They are declared inside functions like
main() or globally outside functions. Declaration tells the compiler the type and name of the variable.Click to reveal answer
Which part of a C program tells the compiler to include standard input/output functions?
✗ Incorrect
The directive #include includes standard input/output functions like printf().
What is the starting point of execution in a C program?
✗ Incorrect
Execution always starts from the main() function in a C program.
What does the statement 'return 0;' in main() signify?
✗ Incorrect
Returning 0 signals that the program finished without errors.
Where are variables usually declared in a C program?
✗ Incorrect
Variables can be declared inside functions like main() or outside functions globally.
Which of these is NOT part of the basic structure of a C program?
✗ Incorrect
HTML tags are not part of a C program structure.
Describe the basic structure of a C program and explain the role of each part.
Think about what the computer needs to start and run your program.
You got /5 concepts.
Explain why the main() function and return 0; are important in a C program.
Consider what happens when you run a program and when it finishes.
You got /2 concepts.