
94 Programming and Data Structures
if(a<c)
smallest=a;
else
smallest=c;
I
else
I
if(b<c)
smallest ^b;
else
smallest =c;
I
printf (“The smallest of% d %d %d is %d \n", a,b,c, smallest);
getcheO;
OUTPUT : Enter Three Numbers : 1 5 8
The smallest of 1 5 8 is
Explanation The logic in the above program is same as the last one. Instead of > (greater than) <
(less than) condition is used.
5.14 Write a program to calculate gross salary for the conditions given below.
BASIC SALARY (RS.) DA(RS.) HRA(RS.) CONVEYANCE(RS.)
>=5000 110% of Basic 20% of Basic 500
bs=>3000 && bs<5000 100% of Basic 15% of Basic 400
bs<3000 90% of Basic 10% OF Basic 300