Professional Documents
Culture Documents
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: