(A) Semicolon not written
(B) Divide by zero
(C) Variable not declared
(D) An expression is wrongly written
Tag: C++ Mcqs
What is an exception in C++ program?
(A) A problem that arises during compilation
(B) Also known as semantic error
(C) Also known as syntax error
(D) A problem that arises during the execution of a program
Which is correct among following?
(A) for(int a=0; a<=10; a++)
(B) for(int a=0: a<=10: a++)
(C) for(int a=0; a<=10; a++);
(D) All are correct[showhide type="post" more_text="►Correct Option" less_text="Show less..."]
Correct Answer is: A
[/showhide]
For, while and do is the?
(A) Keywords
(B) Data type
(C) Variable
(D) All of the above
Correct syntax of while loop is?
(A) while (condition) [body of loop]
(B) while {body of loop}
(C) while (condition) {body of loop}
(D) while (condition); {body of loop}
What is the correct syntax of do while loop?
(A) while {body of loop} do (condition);
(B) do {body of loop} while (condition)
(C) do {body of loop} while (condition);
(D) None of the above
Identify correct sentence of for loop?
(A) for(initialization:condition:increment/decrement);
(B) for(initialization:condition:increment/decrement)
(C) for(initialization;condition;increment/decrement)
(D) for(initialization;condition;increment/decrement);
Which among following is not a loop?
(A) while loop
(B) do while loop
(C) for loop
(D) for it loop