0% found this document useful (0 votes)
10 views

Suez University Final Exam Faculty of Science Time: 2 Hours Depart Mathematical Academic Year 2015/2016 Subject: Computer Languages Date: 2/6/2016

This document is a final exam for a computer languages course given at Suez University, Faculty of Science. The exam contains 3 questions testing knowledge of computer programming concepts like loops, arrays, functions, and conditionals. Question 1 contains 4 subquestions about code snippets involving printing values, flowcharts, arrays, and loops. Question 2 has 3 subquestions about return values from functions, factorials, and checking if a number is odd or even. Question 3 asks the student to write code involving arrays, array initialization, adding arrays, and calculating averages. The exam is 2 hours long and was given on June 2nd, 2016 for the 2015-2016 academic year.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Suez University Final Exam Faculty of Science Time: 2 Hours Depart Mathematical Academic Year 2015/2016 Subject: Computer Languages Date: 2/6/2016

This document is a final exam for a computer languages course given at Suez University, Faculty of Science. The exam contains 3 questions testing knowledge of computer programming concepts like loops, arrays, functions, and conditionals. Question 1 contains 4 subquestions about code snippets involving printing values, flowcharts, arrays, and loops. Question 2 has 3 subquestions about return values from functions, factorials, and checking if a number is odd or even. Question 3 asks the student to write code involving arrays, array initialization, adding arrays, and calculating averages. The exam is 2 hours long and was given on June 2nd, 2016 for the 2015-2016 academic year.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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

You might also like