You are on page 1of 2

Computer Programming

Practice Questions
Q. No. 1

Write a program which prints your name, your date of birth and your
address on screen

Q. No. 2

Write a program which shows addition of 10 and 15 on screen

Q. No. 3

Write a program which saves a value of sum of two numbers in a variable


and show it on screen

Q. No. 4

Write a program which asks user to enter values in three different


variables of int type and show the following on screen
Sum
Product
Average

Q. No. 5

Write a program which shows the following output:


*******************************************
*******************************************
******* Department of Computer Science ********
***********Air University, Islamabad ***********
*******************************************
*******************************************

Page 1 of 2

Q. No. 6

Q. No. 7

Write a program to display the following output using a single cout


statement.
Subject

Marks

Mathematics

90

Computer

77

Chemistry

69

Write a C++ Program for the following equations and display the result.
n1=2, n2=4, n3=6, n4=10;
1) x = n1 + n2 * n3 ( n4 n1 ) / n4

n1=10, n2=5, n3=2, n4=8;


2) Y = n1 /n2 * n3 ( n4 - n2 ) + n3

(Below is an example which we have already covered in previous lab, it will help to write your first code)

Page 2 of 2

You might also like