bsc

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

root / semester_1 / letusc / luc027.c

luc027.c (746B)


      1 /* Rewrite the folowing program using conditional operations
      2     #include<stdio.h>
      3     int main()
      4     {
      5         float sal;
      6         printf("Enter the salary");
      7         scanf("%f", &sal);
      8         if(sal >= 25000 && sal <= 40000)
      9             printf("Manager\n");
     10         else
     11             if(sal >= 15000 && sal < 25000)
     12                 printf("Accountant\n");
     13             else
     14                 printf("Clerk\n");
     15         return 0;
     16     }
     17 */
     18 /* Let Us C, Chap- 4, Page - 73, Qn No.: E(e) */
     19 
     20 #include <stdio.h>
     21 int main()
     22 {
     23     float sal;
     24     printf("Enter the salary");
     25     scanf("%f", &sal);
     26     (sal >= 25000 && sal <= 40000) ? printf("Manager\n") : 
     27     ((sal >= 15000 && sal < 25000) ? printf("Accountant\n") : printf("Clerk\n"));
     28     return 0;
     29 }
© 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