You are on page 1of 1

Alayen University Second Stage

Technical Engineering College Computer Programming 2 A2


Computer Technical Engineering Department Time: 90 minutes
Monthly Exam No: 1 Total Marks: 20

First Question: Choose The Right Choice For Each of the Following: 12 marks
1) The file <iostream>, is short for B. !=
A. Input streams C. !==
B. Input-output streams D. none of above
C. Output streams 8) executing the statement !( 6 < 7) will give
D. none of above A. true
2) int B. false
A. not accepted identifier name C. 0
B. keyword D. none of above
C. accepted identifier name 9) we use the flag controll in loop
D. none of above A. for
3) choose the right declaration of variables B. while
A. int x; z; c; C. do while
B. int x; z, c; D. none of above
C. int x; z, c, 10) in case we execute the statement before evaluating
D. none of above the condition for the first time we use loop
4) a global variable can be accessed by A. for
A. only the main function B. while
B. its function C. do while
C. any function D. none of above
D. none of above 11) If a user-defined function, such as myFunction() is
5) the following number 0x2fg is declared after the main() function it is
A. int A. legal
B. octal B. illegal
C. hexadecimal C. possible
D. illegal D. none of above
6) const int WIDTH = 10; 12) an address of value is passed to the function when
A. legal constant we use
B. illegal constant A. call by value
C. int B. call by reference
D. none of above C. both of them
7) to compare the non-equality, we use D. none of above
A. !!
Second Question: write the output for the following programs: 8 marks
p1- p2- #include <iostream>
#include <iostream>
using namespace std; using namespace std;
int main() {
int main()
{ for (int i = 1; i <= 5; i++) {
double x = 1.2; if (i == 3) { break; }
int sum = (int)x + 1;
cout << i << endl;
cout << "Sum = " << sum;
return 0; }
} return 0; }

best wishes for you all Dr. Eng. Maher Ali Ibrahim

You might also like