INDIAN SCHOOL AL WADI AL KABIR
Worksheet, 2017-18
Class: IX / Computer Science / Date of submission:15-02-2018
SECTION- A
I. FILL IN THE BLANKS:
1. In a program ,statements may be executed sequentially,…………………………or iteratively.
2. ……………………………… are the instructions given to the Computer to perform any kind of action.
3. ……………………………….is an example of entry controlled loop.
4. A...... statement is a group of statements enclosed in the braces { }.
5. …………………………… is an example exit controlled loop.
6. The .…………………….. loop evaluates a test expression at the end of the loop.
7. …………………………………..is an example of selection statement.
SECTION- B
II. MATCH THE FOLLOWING
1. / if else statement / a. / While loop2. / Exit controlled Loop / b. / Executes after the body of loop
3. / Update Expression / c. / Do while loop
4. / Loop Condition / d. / Selection Statement
5. / Entry Controlled loop / e. / Iteration construct
6. / For Loop / f. / Executes before the body of loop
III. TRUE OR FALSE
1. Update Expression is always executed after the body of loop.
2. In an exit controlled loop the body of loop is not executed even once before checking condition.
3. There are three loops available in c++.
4. For an entry controlled loop, if the loop condition is false the loop is not executed even once
5. Selection statements represent the default flow of statement.
6. The for loop gathers all its loop control elements on the top of the loop.
SECTION- C
IV. PREDICT THE OUTPUT
1. for(i=10;i<=50;i+=10)
{
j = i/2;
cout<j<”\t”;
}
2. for(i=10;i<=50;i+=10)
j = i/2;
cout<j<”\n”;
3. int main()
{
int j;
for(j=0; j<15; j++)
cout < j * j < “ “;
cout < endl;
return 0;
}
4. int main ()
{
int a = 10;
do
{
cout < "value of a: " < a < “\n”;
a = a + 1;
}while( a < 20 );
return 0;
}
SECTION- D
V. Answer the following Questions:
1. What are the three constructs that govern statement flow?
2. What is the significance of a test-condition in a loop?
3. Which elements are needed to control a loop?
4. What is a selection statement?
5. Write the syntax of if statement and if –else statement.
6. Define Iteration construct.
7. Write the syntax of the following with example
a) While loop b)Do while loop
c) For Loop
VI. WRITE THE PROGRAM CODE
1. A c++ program to accept a number between 1 to 999 and check whether it is one digit ,two digit or three digit number u sing if statement.
2. A teacher of Tech public school wants to divide her students in the class according to odd or even rollno . Write a c++ program for the same if else.
3. Write a C++ Program that prints 1 2 4 8 16 32 64 using while loop.
4. Write a that displays numbers 2, 4, 6, 8, ….., 18, 20. using Do While loop.
5. Write a C++ Program to accept a number and generate the first 10 multiples of the number
2| Class IX/29-01-2018/ISWK/Comp. Sc