Suez University Final Exam Faculty of Science Time: 2 Hours Depart Mathematical Academic Year 2015/2016 Subject: Computer Languages Date: 2/6/2016
Suez University Final Exam Faculty of Science Time: 2 Hours Depart Mathematical Academic Year 2015/2016 Subject: Computer Languages Date: 2/6/2016
Question 1
1- Assuming var1 starts with the value 50, what will the following
code fragment print out? cout << var1--; cout << var1; cout <<
++var1;
2- What is the difference between while…… do and do…… while
by using flowchart?
3- Find the output for this subprogram
Int N[5]; Int *p;
p=N; *p=10; p++; *p=20;
p=&N[2]; *p=30; p=N+3;
*p=40; p=N; *(p+4)=50;
For(int i=0;i<5;n++) cout<<N[i]<< “,”;
4- Write a while loop and do loop that displays the numbers from
110 to 100.
Question 2
1- How many values can return from a function?
2- Factorial of positive number n defines as n! = n. (n –1). (n –2)
…. 1 write the program receive number from user to compute
and print its factorial.
3- Write a program that let the user enter number and print out the
number is odd or even.
1
Question 3
1- Write a statement that defines a one-dimensional array called
doubleArray of type double that holds 100 elements.
2- For a two-dimensional array of type float, called flarr, write a
statement that declares the array and initializes the first subarray
to 52, 27, 83; the second to 94, 73, 49; and the third to 3, 6, 1.
3- Write the program to print calculate two arrays A+B for 3 rows
and 3 columns.
4- Write a program that calculate the average of set of numbers, let
the user enter any numbers he want and stop when the user
finished
Good Luck
Dr. Yasser Fouad Ramadan