Time: 45:00

🎓 C Programming Assessment

Sessions 1-6 Comprehensive Test

Total Time: 45 minutes | Total Points: 100

📚 Section 1: Programming Fundamentals (20 points)

Q1. What is programming? (4 points)

A) Playing video games on a computer
B) Giving step-by-step instructions to computers
C) Using social media applications
D) Watching videos online

Q2. Which programming language are we learning? (4 points)

A) Python
B) JavaScript
C) C Programming
D) Scratch

Q3. What does IDE stand for? (4 points)

A) Internet Development Environment
B) Integrated Development Environment
C) Interactive Design Editor
D) Intelligent Data Explorer

Q4. Why is C called a "foundation" language? (8 points)

🏗️ Section 2: Program Structure & Syntax (25 points)

Q5. What does #include do? (5 points)

A) Starts the main function
B) Includes input/output functions like printf
C) Ends the program
D) Creates variables

Q6. Every C statement must end with: (5 points)

A) A period (.)
B) A comma (,)
C) A semicolon (;)
D) An exclamation mark (!)

Q7. Find and fix the errors in this code: (15 points)

#include <stdio.h> int main() { printf("Hello World!\n") Printf("Welcome to C programming"); return 0 }

📦 Section 3: Variables & Data Types (20 points)

Q8. Match the data type with its format specifier: (8 points)

Data Types:

1. int

2. float

3. char

Format Specifiers:

A. %c

B. %d

C. %f

Q9. Which variable declaration is CORRECT? (6 points)

A) int 2student = 15;
B) float average-score = 9.5;
C) char student grade = 'A';
D) int studentAge = 13;

Q10. Write a program that declares variables for your name (as a character), age, and height, then displays them: (6 points)

💬 Section 4: Input/Output Operations (15 points)

Q11. What's wrong with this scanf statement? (5 points)

scanf("%d", age);
A) Missing semicolon
B) Wrong format specifier
C) Missing & before age
D) Nothing is wrong

Q12. Complete this interactive program: (10 points)

#include <stdio.h> int main() { int num1, num2; // Ask user for two numbers ________________ // Get the input ________________ // Display the sum ________________ return 0; }

🧮 Section 5: Arithmetic & Math (20 points)

Q13. Calculate: 5 + 3 * 2 - 1 = ? (5 points)

A) 15
B) 9
C) 10
D) 14

Q14. What does 17 % 5 equal? (5 points)

A) 3
B) 2
C) 0
D) 5

Q15. Write a program that calculates the area of a rectangle: (10 points)

The program should ask for length and width, then display the area.

🛠️ Practical Coding Challenge (Bonus: 10 points)

Q16. Create a Simple Calculator Program

Write a complete C program that:
• Asks the user for their name
• Asks for two numbers
• Asks which operation they want (+, -, *, /)
• Performs the calculation
• Displays the result with the user's name

Assessment Complete! 🎉

Your Score: --/100

Feedback will be provided by instructor