Objective: Q1: Write Short Answers To Any NINE Questions

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Objective

1. In a structured programming, the logical flow is governed by __________ basic control


structures:
(a) Two (b) Three (c) Four (d) Five
2. There are ___________ essential elements to a loop
(a) Three (b) Four (c) Five (d) Six
3. _________ is primarily used for executing block of statements a predetermined number of
times:
(a) For (b) While (c) do whilw (d) None
4. In _________ loop, first the body of loop is executed and then the condition is checked:
(a) While (b) do while (c) For (d) All
5. There are ________ expressions given in the For loop to execute it:
(a) One (b) Two (c) Six (d) Three
6. When a while statement is encountered, expression is:
(a) Evaluated (b) Calculated (c) Controlled (d) Communicated

Subjective
Q1: Write Short Answers to any NINE Questions:
1. What is a loop? Why it is used?
2. What is Sentinel Controlled Loop? Give example.
3. Explain the syntax of the Nested loop. Give example.
4. Explain syntax of do-while loop. Give example.
5. Write the difference between continue and break statement.
6. Define Go-to Statement.
7. What is counter controlled loop? Explain with example.
8. Trace the output assuming m=3 and n = 5:
For(k=n; k>0;--k)
{
For(j=m; j>0; --j)
{
Printf(“%d”,j);
}
Printf(“\n”);
}
9. Write a program that takes input from user and print its factorial.
Q2: Attempt Any TWO Long Questions:
A Write a program that takes input from the user and Prints the number in reverse order.
For example (input : 654 and output : 456)
B Write the program that produces the following output:
0
01
012
0123
01234
012345
C Write the program that displays the following pattern
*
**
***
****
*****

You might also like