
Decision Statements 137
Explanation:
In this program also, a menu appears with different arithmetic operations. It requests the user
to enter the required choice number. The choice entered by the user is checked with the if
statement. If it is in between 1 and 6 the if block is executed which prompts the user to enter
two numbers. After this, the choice entered by the user is passed to the switch statement
and it performs relevant operations.
5.19 Write a program that converts number of years into (1) minutes, (2) hours, (3) days, (4)
months and (5) seconds using switch statements.
void main()
{
long ch,min,hrs,ds,mon,yrs,se;
clrscr(); ...