Home Tuitions

Chapter-Flow Of Control

Important MCQ questions for Class 11 Computer Science Chapter-Flow Of Control

Get Important MCQ questions for Class 11 Computer Science Chapter-Flow Of Control with a detailed explanation of all the MCQ questions asked from Chapter-Flow Of Control prepared by the experts. 

Get Selected MCQ-based questions with solutions for Chapter-Flow Of Control

MCQ Questions set-1 for chapter-Flow Of Control class 11 Computer Science 

Computer Science - MCQ on Flow Of Control

Class XI

Q.1. The difference between looping statements and selection statement is

a. loops run until the exit condition is met.

b. loop tests for static condition one time.

c. loops are conditional statements.

d. loops grab information from fields and display it.

Answer:

(a)

Explanation: Loops run until the exit condition is met (meaning the loop variable can change in the loop to cause exit). Selection tests for an existing static condition one time. Looping statements are statements that won't stop its process unless it satisfies its condition while selection statements it will be executed if the input matches one of the selections. The selection that matches the input will be processed.

Q.2. The syntax of switch statement is

a. switch ( expression ) switch.

b. switch ( expression ) statement switch.

c. switch ( expression ) statement.

d. switch (statement) expression.

Answer:

(c)

Explanation: The switch statement executes one or more of a series of cases, based on the value of a controlling expression. The switch statement has the following syntax: switch (expression) Statement

Q.3. The body of user-defined function consists of

a. a font label, an optional default label, a list of statements.

b. a case label, a case expression, a list of programs.

c. a font label, an optional default label, a case expression, a list of
statements.

d. a case label, an optional default label, a case expression, a list of
statements.

Answer:

(d)

Explanation: switch statement is a selection statement that lets us transfer control to different statements within the switch body depending on the value of the switch expression. If the value of the switch expression equals the value of one of the case expressions, the statements following that case expression are processed. If not, the default label statements, if any, are processed.

Q. 4. A case label contains the word case followed by

a. an integral constant expression and a colon.

b. an character constant expression and a colon.

c. an integral constant expression and a semi-colon.

d. an character constant expression and a semi-colon.

Answer:

(a)

Explanation: A case label contains the word case followed by an integral constant expression and a colon. The value of each integral constant expression must represent a different value.

Q. 5. In while loop, the evaluation is done at the

a. bottom of the loop.

b. top of the loop.

c. middle loop.

d. top or bottom of the loop.

Answer:

(b)

Explanation: In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. Here the evaluation is done at the top of the loop.

Q. 6. In a do while loop, evaluation is done at the

a. bottom of the loop.

b. top of the loop.

c. middle loop.

d. top or bottom of the loop.

Answer:

(a)

Explanation: In most computer programming languages, a do while loop, sometimes just called a do loop, is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. Here, the evaluation is done at the bottom of the loop.

Q.7. In a for loop, evaluation is done at the

a. bottom of the loop.

b. top of the loop.

c. middle loop.

d. top or bottom of the loop.

Answer:

(b)

Explanation: In computer science, a for loop is a programming language statement, which allows code to be repeatedly executed at the top of the loop. A for loop is classified as an iteration statement.

Q. 8. The statement i++; is equivalent to

a. i=i+1.

b. i=i-1.

c. i=i+i.

d. i=i+0.

Answer:

(a)

Explanation: i++ is equal to i+1. ++ is an increment operator which increments value by 1.

Q. 9. The statement i--; is equivalent to

a. i=i+1.

b. i=i-1.

c. i=i+i.

d. i=i+0.

Answer:

(b)

Explanation: i-- is equal to i-1. -- is a decrement operator which decrements value by 1. For example a--is equal to a-1.

Q.10. If there is more then one statement in the block of a for loop, the bracket, which is placed at the beginning and the ending of the loop block, is

a. parenthesis ().

b. braces {}.

c. brackets [].

d. arrows <>.

Answer:

(b)

Explanation: {} are used for more than one statement in the block of a for loop. When there is a single statement then () are used. Example: for (i=0;i<10;i++). It will execute the code within for loop 10 times.

Q.11. A continue statement causes execution to skip to

a. return 0; statement.

b. the first statement after the loop.

c. the statement following the continue statement.

d. the next iteration of the loop.

Answer:

(d)

Explanation: Continue statement ends the current iteration of a loop. Program control is passed from the continue statement to the end of the loop body.

Q. 12. Error in the following code is

while (i<10) && (i>24)

a. the logical operator && cannot be used with while statement.

b. the while loop is an exit condition loop.

c. the test condition is always false.

d. the test condition is always true.

Answer:

(c)

Explanation: Here, the condition controlling the execution of the loop is always false. It will never be true.

Q. 13. Error in the code below is

for (k=0, k<10, k++)

a. instead of commas semicolon should be used.

b. there should be a semicolon at the end of the statement.

c. there is no error.

d. the increment should always be ++k.

Answer:

(a)

Explanation: In for loop the proper syntax is for (initialization; condition; increment). So it should be for (k=0; k<10; k++).

Q. 14. << and >> are called

a. cascading stream.

b. stream.

c. cascading stream of input and output operators.

d. keywords.

Answer:

(c)

Explanation: << is called insertion or put to operator. It directs the contents of the variable on its right to the object on its left. >> is extraction operator. Together these are called as cascading stream of input and output operators.

Q.15. Smallest individual unit in a program is called

a. token/lexical unit.

b. keyword.

c. identifier.

d. functions.

Answer:

(a)

Explanation: A token is the smallest element of a C++ program that is meaningful to the compiler. It includes keywords, identifiers and literals.