bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_1 / letusc / luc011.c

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, &shyam, &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 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror