 اسئلة واجوبة لسنوات سابقة   أستــاذ المــادة  هديل قاسم غني   تـاريـخ النشــر   22/12/2017 Q1: A-Write a C++ to read three numbers and print their average; Sol: #include using namespace std; void main ( )  {     float x , y , z ;     float  av ;     cout << " Enter Three Integer Values :\n " ;     cin >> x >> y >>z ;     av= ( x+y+z ) / 3;      Cout << " The average =  "  << av ; } Q1:B-  Define the following terms: Coputer, programming   Sol: Computer: is a device capable of performing computations and making logical decisions at speeds millions and even billions of times faster than human beings. Programming: is the process of writing instructions for a computer in a certain order to solve a problem.   Q2:A  What is the output of the following program?   #include void main( ) { int a, b; float  first , second, third; a=13; b=3; first= a + b; second=a/b; third=a%b; cout << "The Results are as follows"< void main( ); { it a,c; a=10; b=21; c=a+b cout<> “the result is:" cot< void main( ) { int a,b,c;                                  a=10; b=21; c=a+b; cout<>c;                    The output the result is: 31   Q3:B What is an algorithm mean, list the properties of an  Algorithm.   Sol:  In programming, algorithm are the set of well-defined instruction in sequence to solve a program. An algorithm should always have a clear stopping point.   Properties are:   1. Inputs and outputs should be defined precisely. 2. Each steps in algorithm should be clear and unambiguous. 3. Algorithm should be most effective among many different ways to solve a problem. 4. An algorithm shouldn t have computer code. Instead, the algorithm should be written in such a way that, it can be used in similar programming languages.   Q4/A Write an algorithm for Printing numbers from 1 to 20:   Sol: Step 1: Start Step 2: Initialize X as 0 Step 3: Increment X by 1 Step 4: Print X Step 5: If X is less than 20 then go back to step 3 Step 6: Stop   Q4:B: What is the output of the following C++ program #include void main( ) { int x, y, z, r ; Output                                       x= 7 / 2; cout << "x=" << x <