Sie sind auf Seite 1von 2

CITS ACADMEDY Week 3

COMPUTER
CLASS ICS Part-2 SUBJECT TOTAL MARKS 50
CH#12&13
NAME DATE TIME ALLOWED 1:30 HR.

Question.No.1: Encircle the right Answer (10)


1. One Execution is known as
a) Iteration b) cycle c) Test d) Duration
2. Which statement is used to move control to the start of loop body?
a) Break b) Continue c) Goto d) Switch
3. Repetition structure is used to execute a statement or set of statement.
a) Statement b) All c) Once d) More than one time
4. A ______ is used to perform the same sequence of steps or automating tasks repeatedly
a) Macro b) Forms c) Module d) Reports
5. The loop of structure in which condition comes after the body of the loop is
a) Do loop b) For loop c) Do while loop d) While loop
6. Memory is allocated to a local variable at the time of its:
a) Declaration b) Destruction c) Definition d) first reference
7. The name of actual and formal parameters:
a) May or may not be same b) must be same c) must be different d) must be in lowercase
8. Formal arguments are also called:
a) Actual arguments b) dummy arguments c) original arguments d) referenced arguments
9. printf() is a:
a) Built-in function b) user-defined function c) Local function d) keyword
10. Which of the following looks for the prototypes of functions used in a program
a) Linker b) loader c) compiler d) parser
Question.No.2: Attempt any 6 questions (6*2=12)
1. Why loops are used?
2. What is the difference between while and do-while loop?
3. What is ‘goto’ statement?
4. Define for loop?
5. What is do-while loop?
6. Define iteration
7. Write a program to print even numbers using loop
8. Write output if it does not have any error.
1. for ( int x=0 ; x<=5 ; x+=1) { cout<<”N = ”<<x<<endl; }
Question.No.3: Attempt any 6 questions (6*2=12)
1. What is modular programming?
2. What is a function?
3. What is life time of global variable?
4. What are parameters?
5. What is return statement?
6. What are built-in functions?
7. Why functions are used?
8. Write a program that call a function three times.
Question.No.4: Attempt the following questions (2*8=16)
1. Write a program that prompts the user to enter a number and then reverse it. Write a function
Reverse to reverse the number. For example. If the user enters 2765, the function should reverse it so
that it becomes 5672. The function should accept the number as an input parameter and return the
reversed number.
2. Write a function named Draw Asterisks that will print asterisks (*) according to the pattern shown in
the following and make a function call from the function main to print the asterisks pattern.
*********
*******
*****
***
*
3. Write a program that inputs a number and displays the message "prime number" if it is a prime
number otherwise displays “Not prime number".

Das könnte Ihnen auch gefallen