2nd Year Computer Chapter 12 Notes
Important Full 2nd Year Computer Chapter 12 Notes written by Professor Mr. Tayyab Shahzad. These notes are very helpful in the preparation of 2nd year computer chapter 12 important questions of 2nd year Computer Science for the students of the intermediate and these are according to the paper patterns of all Punjab boards.
Summary and Contents:
Topics which are discussed in the notes are given below:
- Important Multiple Choice Questions of 2nd year computer chapter 12 mcqs of 2nd-year Computer Science.
- Q1: A loop that never ends is called: (a) Infinite loop (b) Running loop (c) Nested loop (d) Continuous loop
- Q2: One execution of a loop is known as a (n): (a) Test (b) Iteration (c) Duration (d) Integer
- Q3: A special value that terminates the loop is called: (a) Terminate value (b) Sentinel value (c) Control value (d) End value
- Q4: Which one is not a loop structure? (a) Switch (b) For (c) While (d) Do-while
- Q5: Following is a control structure that causes a statement or group of statements to repeat: (a) Decision statement (b) Loop (c) Sequential (d) Logical
- Important 2nd year computer chapter 12 mcqs with answers for Intermediate part-II students.
- Q6: A loop counter can be defines as: (a) The final value of a loop (b) The initial value of a loop (c) A variable that counts loop iterations (d) The step value of a loop
- Q7: _____ is a loop statement: (a) If (b) While (c) If-else (d) Switch
- Q8: While loop is also called: (a) Conditional loop (b) Do-while loop (c) For loop (d) All of these
- Q9: Following in the while loop statement controls the loop iteration:
- (a) Colon (b) Semicolon (c) Condition (d) { }
- Q10: The while loop body with multiple statements ends with:
- (a) Right brace } (b) Right bracket ] (c) Comma (d) Semicolon
- Important 2nd year computer chapter 12 important mcqs for Intermediate part-II students.
- Q11: In while loop , the loop control variable is always initialized? (a) Outside the program (b) After loop ends (c) Inside the loop body (d) Outside the body of loop
- Q12: A variable whose value controls the number of iterations is known as ___: (a) Variable (b) Loop Variable (c) Control Variable (d) Loop Control Variable
- Q13: Examine the following code and tell output:
int count = -2; while ( count <3 ) { printf ("%d", count); count + = 1 ; }
- (a) -2-11234 (b) -2-1123 (c) -3-4-5-6-7 (d) -2-1012
- Q14: Semicolon is placed at the end of condition in: (a) Switch (b) For loop (c) While loop (d) Do-while loop
- Q15: The___loop will execute at least once even the condition is false:
- (a) While (b) Do-while For All of these
- Q16: A counter can be defines as:
(a) The final value of a loop (b) The starting value of a loop (c) A variable that counts loop iteration (d) The step value of a loop
- Important 2nd year computer chapter 12 short questions for Intermediate part-II students.
- What is a Control structure?
- What is meant by sequence-structure?
- What is meant by selection structure?
- What is meant by repetition structure?
- What is an IF statement?
- Important 2nd year computer chapter 12 important long questions for Intermediate part-II students.
- What is a compound statement?
- What is an if-else statement?
- What is an if-else-if statement?
- Important 2nd year computer chapter 12 long questions for Intermediate part-II students.
- What is a conditional operator? Ans: The conditional operator is used as an attribute of simple if-else statement. It is used to
make two way decision.
The general syntax of conditional operator is
(Condition)? Statement 1: Statement 2; Condition should be a logical or relation expression. After evaluation if the result of
condition is true then statement 1 is executed. If result of condition is false then
statement 2 is executed.
- Important 2nd year computer chapter 12 long questions pdf download for Intermediate part-II students.
- What is a switch statement? Ans: Switch statement is an alternative of if-else-if statement. It is also a conditional statement.
It is used when we want to execute a block on statements from multiple blocks.
The general syntax of switch statement is
Switch (expression) {
break;
} case constant-expression: statement (s);
case constant-expression: statement (s);
break; default: statement(s);
- What is a nested if statement?
- What is a break statement?