Introduction to Programming MCQs with Answers
Practice important Introduction to Programming MCQs with answers and explanations.
Multiple Choice Questions
Q71: What is the purpose of an 'if' statement in C programming?
- A: To execute a block of code based on a condition
- B: To repeat a block of code multiple times
- C: To terminate the execution of a program
- D: To perform calculations
View Answer
A
Q72: In the statement 'if (condition)', what will happen if the condition is true?
- A: The statement or group of statements will execute
- B: The condition will be checked again
- C: The condition will be false
- D: The program will terminate
View Answer
A
Q73: What does the '==' operator signify in C?
- A: Assignment operator
- B: Equal to operator
- C: Not equal to operator
- D: Comparison operator
View Answer
B
Q74: What will happen if you mistakenly use a single '=' instead of '==' in an 'if' condition?
- A: It will give a syntax error
- B: The condition will always be true
- C: The condition will always be false
- D: It will create a logical error
View Answer
D
Q75: Which symbol is used to create a block of statements in C?
- A: { } (curly braces)
- B: () (parentheses)
- C: [] (square brackets)
- D: : : (colon)
View Answer
A
Q76: What does the 'else' part of an 'if/else' structure represent?
- A: It executes when the 'if' condition is false
- B: It executes when the 'if' condition is true
- C: It checks if the 'if' condition is true
- D: It skips the rest of the program
View Answer
A
Q77: In logical operators, what does the '&&' operator represent?
- A: OR
- B: AND
- C: NOT
- D: XOR
View Answer
B
Q78: What will the '||' (OR) operator return if both expressions are false?
- A: False
- B: True
- C: It will return True or False randomly
- D: True and False are mixed
View Answer
A
Q79: What does the '!' operator do in C?
- A: It reverses the logical value of a condition
- B: It checks if a condition is true
- C: It assigns a value to a variable
- D: It ends the program
View Answer
A
Q80: What is the purpose of flowcharting in program design?
- A: To visually design the sequence of instructions
- B: To write the actual code of a program
- C: To check the performance of the code
- D: To convert code into machine language
View Answer
A