luc011.c (743B)
1 /* If ages of Ram, Shyam and Ajay are input through the keyboard, 2 write a program to determine the youngest of the three. */ 3 /* Let Us C, Chap- 3, Page - 53, Qn No.: f(b) */ 4 5 #include <stdio.h> 6 int main() 7 { 8 int ram, shyam, ajay; 9 printf("Please enter the age of Ram, Shyam and Ajay : "); 10 scanf("%d %d %d", &ram, ­am, &ajay); 11 if (ram == shyam || ram == ajay || shyam == ajay) 12 printf("\nThree must have different age."); 13 if (ram < shyam && ram < ajay) 14 printf("\nRam is the youngest. Age : %d", ram); 15 if (shyam < ram && shyam < ajay) 16 printf("\nShyam is the youngest. Age : %d", shyam); 17 if (ajay < ram && ajay < shyam) 18 printf("\nAjay is the youngest. Age : %d", ajay); 19 return 0; 20 }