0% found this document useful (0 votes)
50 views2 pages

Answer As You Can: Ques On 1

1) The document contains a final exam for a computer programming course with 3 questions. 2) Question 1 contains 4 programming problems involving variables, loops, arrays, and output. Question 2 contains 4 additional problems with loops, arrays, and functions. 3) Question 3 contains 5 problems involving arrays, loops, calculations, and Fibonacci series. The exam tests a variety of programming fundamentals and requires both writing and analyzing code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

Answer As You Can: Ques On 1

1) The document contains a final exam for a computer programming course with 3 questions. 2) Question 1 contains 4 programming problems involving variables, loops, arrays, and output. Question 2 contains 4 additional problems with loops, arrays, and functions. 3) Question 3 contains 5 problems involving arrays, loops, calculations, and Fibonacci series. The exam tests a variety of programming fundamentals and requires both writing and analyzing code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Course Code: ENG105

Ministry of Higher Education


Computer Programing
Canal High Institute of Engineering &
Time: Three Hours
Technology
Final exam
Suez
Date : 20 / 1 / 2016

Answer as you can

Ques on 1

1- Assuming var1 starts with the value 50, what will the following code
fragment print out? cout << var1--; cout << var1; cout << ++var1; (6)
2- What is the difference between while…… do and do…… while by
using flowchart? (6)
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]<< “,”; (12)
4- Write a while loop and do loop that displays the numbers from 110
to 100. (10)
Ques on 2

1- Use for loops to construct a program that displays a pyramid of Xs on


the screen. The pyramid should look like this? (10)
X
XXX
XXXXX
XXXXXXX
2- How many values can return from a function? (5)
3- 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. (10)
4- Write a program that let the user enter number and print out the
number is odd or even. (10)
Question 3

1- Write a statement that defines a one-dimensional array called


doubleArray of type double that holds 100 elements. (7)
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. (8)
3- Write the program to print calculate two arrays A+B for 3 rows and 3
columns. (10)
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.(10)
5- Write a program that calculate the Fibonacci series here are the first
few terms of the series: 1 1 2 3 5 8 13 21 34 55 (10)
Good Luck

Dr. Yasser Fouad Ramadan

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy