sahajjain01

22.Input marks and print remarks.

Sep 2nd, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. //Program to input marks and print remarks.
  2. #include<stdio.h>
  3. #include<conio.h>
  4.  
  5. void main()
  6. {
  7.     int number_1, number_2, number_3;
  8.     float avg;
  9.  
  10.     clrscr();
  11.  
  12.     printf("Enter marks of three subjects: ");
  13.     scanf("%d%d%d", &number_1, &number_2, &number_3);
  14.  
  15.     avg = (number_1 + number_2 + number_3) / 3;
  16.  
  17.     if(avg > 90)
  18.         printf("Excellent! :D");
  19.     else if(avg > 70)
  20.         printf("Good! :) ");
  21.     else if(avg > 50)
  22.         printf("Satisfactory. :/ ");
  23.     else if(avg > 32)
  24.         printf("Just pass... -_-");
  25.     else
  26.         printf("Fail. XD");
  27.  
  28.     getch();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment