Reference no: EM132392261
If Else if and While Exercises -
1) Write a program to ask the user to enter three numbers. Find the smallest of three numbers.
2) Write a program to ask the user to enter the marks obtained by the students in 3 subjects.
Then calculate the average marks obtained by the student.
If marks > 85 then display message "Grade A"
If marks > 75 and less than 85 then display message "Grade B"
If marks >65 and less than 75 then display the message "Grade C"
If marks <65 and greater than 50 then display the message "Grade D"
If marks less than 50 then Display the message "Fail"
Note: Use of logical operators is not allowed.
3) Write a program to check if a number is divisible by 3 or 7.
4) Write a C++ program that for a given positive number outputs all the odd numbers separated by a space between 0 and that number.
Hint: Cout>>"Enter the number up to which you wish to print the sum of odd numbers"
5) Write a program to print prime numbers between 1 and 50.
6) Write a program to ask the user to enter interior angles of a triangle.
Check whether the angles entered will form a triangle or not.
7) Write a program to ask the user to enter 4 values which represent either the sides of a geometrical figure. Determine whether it is a quadrilateral, a square or a rectangle.
Note: You are not required to enter the angles. Only ask the user to enter the sides of the geometrical figure.
8) Write a program to ask the user to enter time in 24hr format. Based on the number entered display whether it is morning, afternoon, evening or night.
Attachment:- Assignment File.rar