Anik_Akash

lab_ternary.c

Jun 13th, 2020
113
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #define n 5.00
  3. int main()
  4. {
  5.     double ph, ch, bi, ma, co, sum, y;
  6.     printf("Input marks of five subjects: ");
  7.     scanf("%lf %lf %lf %lf %lf",&ph, &ch, &bi, &ma, &co);
  8.  
  9.     sum = ph+ch+bi+ma+co;
  10.     y = sum/n;
  11.     (y>=90.00)?(printf("Percentange =%.2lf\nGrade A\n",y)):
  12.     (y>80.00)?(printf("Percentange = %.2lf\nGrade B\n", y)):
  13.     (y>=70.00)?(printf("Percentange =%.2lf\nGrade C\n",y)):
  14.     (y>=60.00)?(printf("Percentange =%.2lf\nGrade D\n",y)):
  15.     (y>=50.00)?(printf("Percentange =%.2lf\nGrade E\n",y)):
  16.     (printf("Percentange = %.2lf\nGrade F\n", y));
  17.  
  18.     return 0;
  19. }
RAW Paste Data