
5-27
Decision Statements
Explanation:
In this program also, a menu appears with dierent arithmetic operations. It requests the user
to enter the required choice number. e 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. Aer this, the choice entered by the user is passed to the switch() statement
and it performs relevant operations.
5.22 Write a program to convert 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();
printf(“\n[1] ...