Академический Документы
Профессиональный Документы
Культура Документы
Computer Programming – FALL II‐09
Course Instructor : Muhammad Umair
www.umairm.webs.com
Please Note:
I. You are not required to submit the solution however your file should contain the solution.
Q1: Construct a table which shows the execution of for loop? Do you find any logical error in any of the
following codes? (No code is required, solve on paper)
a)for (int a=0;a!=5;a++)
{
cout << “a= “ << a;
}
b) for (int count=5;count>0;count‐‐)
{
count‐‐;
cout << count+5;
}
c)for (int data=7;data !=4; data++)
{
cout << data*data
}
Q2: Write a program which inputs the age of 5 students and then shows the age of oldest and youngest
student along with class age average?
Q3: Write a program which inputs two variable (input1 & input 2) and then show the values as
following? (Assuming user entered 23 and 34 for input1 & input2 respectively)
Page 1