Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int phy, che, bio, math, com;
- float percen;
- printf("Give your Marks of Physics:\n");
- scanf("%d", &phy);
- printf("Give your Marks of Chemistry:\n");
- scanf("%d", &che);
- printf("Give your Marks of Biology:\n");
- scanf("%d", &bio);
- printf("Give your Marks of Mathematics:\n");
- scanf("%d", &math);
- printf("Give your Marks of Computer:\n");
- scanf("%d", &com);
- printf("\nYour Marks respectively Physics, Chemistry, Biology, Mathematics and Computer is %d %d %d %d %d \n", phy, che, bio, math, com);
- percen = (phy + che + bio + math + com) / 5;
- printf("Percentage = %.2f\n", percen);
- if(percen >= 90 && percen <= 100){
- printf("Your Grade is A");
- }else if(percen >= 80 && percen < 90){
- printf("Your Grade is B");
- }else if(percen >= 70 && percen < 80){
- printf("Your Grade is C");
- }else if(percen >= 60 && percen < 70){
- printf("Your Grade is D");
- }else if(percen >= 40 && percen < 60){
- printf("Your Grade is E");
- }else{
- printf("Your Grade is F");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement