bsc

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

luc027.c (882B)


      1 /*
      2  * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025
      3  * Repo: https://github.com/notamitgamer/bsc
      4  * License: MIT
      5  */
      6 
      7 /* Rewrite the folowing program using conditional operations
      8     #include<stdio.h>
      9     int main()
     10     {
     11         float sal;
     12         printf("Enter the salary");
     13         scanf("%f", &sal);
     14         if(sal >= 25000 && sal <= 40000)
     15             printf("Manager\n");
     16         else
     17             if(sal >= 15000 && sal < 25000)
     18                 printf("Accountant\n");
     19             else
     20                 printf("Clerk\n");
     21         return 0;
     22     }
     23 */
     24 /* Let Us C, Chap- 4, Page - 73, Qn No.: E(e) */
     25 
     26 #include <stdio.h>
     27 int main()
     28 {
     29     float sal;
     30     printf("Enter the salary");
     31     scanf("%f", &sal);
     32     (sal >= 25000 && sal <= 40000) ? printf("Manager\n") : 
     33     ((sal >= 15000 && sal < 25000) ? printf("Accountant\n") : printf("Clerk\n"));
     34     return 0;
     35 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror