SUBJECT: COMPUTER SESSION 2023 – 2025 DATE: 0-02-2025 TIME ALLOWED
CLASS: SECOND YEAR R&T-10 TOTAL MARKS: 40 1Hour 20MINS
Std. Name: Section: Roll No.
Note: Four possible answers A, B, C and D are given. The choice which you think is correct, fill that circle in front of that
questions with Marker or Pen Ink. Cutting or filling two or more circles will result in zero mark in that question.
Q.1: Each question has four possible answers. Choose the correct answer. (6×1= 6)
1: How many loop types of loop structure are available in C language?
(A) 4 (B) 3 (C) 2 (D) 6
2: Which symbol is used to enclose the statements in the body of a loop?
(A) {} (B) /**/ (C) Begin end (D) ()
3: The ______ statement performs an unconditional transfer of control to the named label.
(A) Goto (B) if-else (C) for (D) while
4: There are three situation is for loop separated by:
(A) Comma (B) Colon (C) Semicolon (D) Equal
5: The keyword “break” cannot be used within:
(A) do-while (B) if-else (C) for (D) while
6: ______ part of loop executes first.
(A)Condition (B) Body (C) Initialization (D) Increment/ Decrement
SECTION – I
Q.2: Write short answers. (9×2=18)
(i) Which part of loop contains the statements to be repeated?
(ii) Write the syntax of do while loop.
(iii) How does a programmer decide to use a while loop versus a for loop?
(iv) What is counter control loop?
(v) Why is sentinel value used in loops?
(vi) What is post-test loop?
(vii) What is infinite loop?
(viii)Convert the following code into while loop. Int I; for(i=1;i<=10;i++) { printf(“\n Pakistan”) }
(ix) What is nested loop?
SECTION – II
Q.3: Explain the following Long Questions. (8×2=16)
Write a program in C language that input a number and print its table using loop.
Write a program that prints series of even numbers from 1 to 100 using loop.