Exercises
Put your C programming fundamentals to the test with this beginner-friendly quiz. Answer questions covering Hello World syntax, variable declarations and naming rules, single-line comments, printf output, array indexing, built-in data types, constants, the return type of main(), and the purpose of function prototypes. Whether you are new to C or reviewing core concepts before an exam, this quiz is a quick way to check your understanding of essential C language syntax and programming principles.
Answer the questions below and check the explanation for each answer.
0/10 answered
Auto audio on: the next questions will be read aloud when you click Continue.
The correct function to print to the standard output in C is printf. The statement should be printf(Hello World); where printf is a function declared in stdio.h.
In C, variables need both type declaration and their initial value should be provided when desired. Option int number = 5; correctly declares and initializes the variable.
In C, single line comments are made using //. Anything after these symbols on that line will be considered a comment.
The correct format specifier %d is used for integers. Thus, printf(%d, x); will correctly output the integer 10.
Variable names cannot start with a digit. Hence, 1value is not a valid variable name in C.
Elements of an array in C are accessed using the square brackets []. The syntax is array[index] where index is the position of the element.
There is no direct String data type in C. Strings in C are handled as arrays of char.
The keyword const is used in C to define a constant variable whose value cannot be changed after initialization.
The return type of the main function in a standard C program is int which usually signifies the exit status of the program.
A function prototype is used to inform the compiler about the function name, return type, and parameters, allowing type checking before the function call.

Free CourseLearn Python
13h00m
17 exercises

Free CourseJava Programming
9h15m
48 exercises

Free CourseCreate Desktop App
5h33m
30 exercises

Free CourseRuby on Rails
9h39m
34 exercises

Free CourseJava
22h17m
28 exercises

Free CourseC# Sharp for beginner
3h55m
15 exercises

Free CourseC++ as your first Programming Language
5h12m
23 exercises

Free CourseJava for beginners
26h50m
49 exercises
Thousands of online courses in video, ebooks and audiobooks.
To test your knowledge during online courses
Generated directly from your cell phone's photo gallery and sent to your email
Download our app via QR Code or the links below:.
+ 10 million
students
Free and Valid
Certificate
60 thousand free
exercises
4.8/5 rating in
app stores
Free courses in
video and ebooks