You are on page 1of 7

Question 1: Write a program that asks the user to enter two

integer numbers and then, a. displays larger and smaller


numbers on the screen. b. divides the larger number by the
smaller one and displays the quotient and remainder on the
screen. c. It repeats the process until user enters n to stop the
program. d. If divisor is zero it says illegal divisor. (Hint: Use
continue statement)
Input:
OUTPUT:

Question 2:
Write a program that tells you whether a number you enter is a
prime number. If the number is not prime, the program tells you
and stops the execution. (Hint: You can use exit(0) function of
process header file.)

Input :
Output :
Question 3:
Write a program that tells the user the timetable of your
section for the day number and lab group number entered by
the user. (Hint: 1 for Monday, 2 for Tuesday, … , 5 for Friday. 1
for Lab Group 1 and 2 for Lab Group 2.)
Input:

Output:
Question 4: Write a program that displays the Title of degree
for the affiliated institutes of UET Taxila properly in the
following pattern. You should ask the user to select 1 for
Electrical, 2 for Mechanical, and 3 for Civil. 1 for Swedish
College of Engineering and Technology, 2 for Army Public
College of Management and Sciences, 3 for Infinity Institute of
Technology, and 4 for Metropolitan International United
College. (Hint: Use setw() to properly place the title as
mentioned below.)

Input:
Output:

You might also like