AbdulFathaah

grade

Sep 26th, 2023
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. int C,CF,DM,ST,EN;
  6. float total,score;
  7. char Grade,cfG,cG,Name[10];
  8. clrscr();
  9. printf("Enter name of student: ");
  10. scanf("%s",&Name);
  11. printf("\nEnter mark of C: ");
  12. scanf("%d",&C);
  13. if(C<0 && C>100)
  14. printf("Re enter Mark");
  15. if(C>=90)
  16. cG='A';
  17. else if(C>=80 && C<=89)
  18. cG='B';
  19. else if(C>=70 && C<=79)
  20. cG='C';
  21. else if(C>=60 && C<=69)
  22. cG='D';
  23. else if(C>=50 && C<=59)
  24. cG='E';
  25. else if(C<50)
  26. cG='F';
  27. else
  28. printf("INVALID ENTRY");
  29.  
  30.  
  31. printf("\nEnter mark of CF: ");
  32. scanf("%d",&CF);
  33. if(CF<0 && CF>100)
  34. printf("CF<0 && CF>100");
  35. if(CF>=90)
  36. cfG='A';
  37. else if(CF>=80 && CF<=89)
  38. cfG='B';
  39. else if(CF>=70 && CF<=79)
  40. cfG='C';
  41. else if(CF>=60 && CF<=69)
  42. cfG='D';
  43. else if(CF>=50 && CF<=59)
  44. cfG='E';
  45. else if(CF<50)
  46. cfG='F';
  47. else
  48. printf("INVALID ENTRY");
  49.  
  50. printf("\nEnter mark of DM: ");
  51. scanf("%d",&DM);
  52. if(DM<0 && DM>100)
  53. printf("Re enter Mark");
  54. printf("\nEnter mark of ST: ");
  55. scanf("%d",&ST);
  56. if(ST<0 && ST>100)
  57. printf("Re enter Mark");
  58. printf("\nEnter mark of EN: ");
  59. scanf("%d",&EN);
  60. if(EN<0 && EN>100)
  61. printf("Re enter Mark");
  62. total=EN+ST+DM+C+CF;
  63. score=total/5;
  64. printf("\nName of the student:%s",Name);
  65. printf("\nGrade of C=%c",cG);
  66. printf("\nGrade of CF=%c",cfG);
  67. if(score>=90)
  68. printf("\nGrade of the student= A");
  69. else if(score>=80 && score<=89)
  70. printf("\nGrade of the student= B");
  71. else if(score>=70 && score<=79)
  72. printf("\nGrade of the sudent= C");
  73. else if(score>=60 && score<=69)
  74. printf("\nGrade of the student= D");
  75. else if(score>=50 && score<=59)
  76. printf("\nGrade of the student= E");
  77. else if(score<50)
  78. printf("\nGrade of the student= F");
  79. else
  80. printf("Invalid Entry");
  81.  
  82. getch();
  83. }
Advertisement
Add Comment
Please, Sign In to add comment