C Programming Challenge: 10 Multiple-Choice Questions to Test Your Knowledge.

 Introduction

Top 10 M.C.Q:- Questions and Answers for improving and understanding C Programming. Learn and Understand C Programming like Pro.

1. Question: What is the syntax to declare a variable in C?

A. variableName type;

B. type variableName;

C. var variableName = type;

D. declare variableName as type;

Correct Answer: B

2. Question: Which of the following is not a valid C data type?

A. int

B. float

C. boolean

D. char

Correct Answer: C

3. Question: What is the correct way to include a header file in C?

A. #import <header.h>

B. #include <header.h>

C. #require "header.h"

D. #add "header.h"

Correct Answer: B

4. Question: In C, what is the result of the expression 5 / 2?

A. 2

B. 2.5

C. 2.0

D. 2.5f

Correct Answer: A

5. Question: What is the purpose of the sizeof operator in C?

A. To find the size of a file

B. To find the size of an array or data type in bytes

C. To check the existence of a variable

D. To convert data types

Correct Answer: B

6. Question: Which C function is used to print formatted output?

A. printf()

B. scanf()

C. print()

D. display()

Correct Answer: A

7. Question: What does the break statement do in C?

A. Exits the program

B. Exits the current loop or switch statement

C. Skips the next iteration of the loop

D. Continues to the next case in a switch statement

Correct Answer: B

8. Question: What is the correct way to declare a pointer in C?

A. int ptr;*

B. pointer int ptr;

C. int ptr;

D. point int ptr;*

Correct Answer: A

9. Question: In C, what does the & operator do when applied to a variable?

A. Declares a new variable

B. Returns the memory address of the variable

C. Checks if the variable is equal to another variable

D. Multiplies the variable by itself

Correct Answer: B

10. Question: What is the purpose of the scanf() function in C?

css
**A. To print formatted output** 
**B. To read input from the user** 
**C. To perform mathematical calculations** 
**D. To declare variables** 
 **Correct Answer: B**

Post a Comment

Post a Comment (0)

Previous Post Next Post