Q1

What is the primary purpose of a comment in C programming?
A. Display information on the console
B. Enhance code readability
C. Define variables
D. Execute a specific block of code
Which data type is used to store whole numbers in C?
A. float
B. double
C. int
D. char
What is the correct syntax for declaring a character variable named 'ch'?
A. Char ch = 'A';
B. Character ch = 'A';
C. ch = 'A';
D. Var ch = 'A';
Which function is used to print formatted output in C?
A. print()
B. display()
C. printf()
D. show()
What is the format specifier for printing a float variable in C?
A. %d
B. %f
C. %c
D. %s
Which function is used to take input in C programming?
A. input()
B. get()
C. scanf()
D. read()
What is the correct syntax for reading an integer using scanf?
A. scanf("%d", &num);
B. read("%d", num);
C. get("%d", &num);
D. input("%d", num);
What are the data types in C?
Int
Float
Num
Bool
Double
Char
Book
Bit
Long
Short
Unsigned
In a switch statement, what is the purpose of the 'break' statement?
A. Terminate the program
B. Skip the current case and move to the next
C. Exit the loop
D. End the current case and exit the switch
What is the purpose of a do-while loop in C?
A. Execute a block of code while a condition is true
B. Execute a block of code at least once, then check the condition
C. Execute a block of code based on a counter
D. Iterate over a range of values
Which of the following is a common mistake in C programming?
A. Using descriptive variable names
B. Avoid using comments
C. Using appropriate indentation
D. Initializing variables before use
What is a good practice when writing C code for better readability?
A. Use single-letter variable names
B. Avoid using comments
C. Write long functions with multiple responsibilities
D. Break code into smaller, modular functions
What will be the output of the above C code?
What will be the output of the above C code?
What will be the output of the above C code?
{"name":"Q1", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What is the primary purpose of a comment in C programming?, Which data type is used to store whole numbers in C?, What is the correct syntax for declaring a character variable named 'ch'?","img":"https://www.quiz-maker.com/3012/CDN/97-4755883/123.jpg?sz=1200"}
Make your own Survey
- it's free to start.