// Online C compiler to run C program online #include <stdio.h> int main() { int a; int b; printf("Enter marks from part 1 :"); scanf("%d",&a); printf("Enter marks from part 2: "); scanf("%d",&b); int totalMarks =(a+b)/2; printf("Total marks of the paper: %d\n",totalMarks); if(totalMarks>=75){ printf("Grade: A"); } else if(totalMarks>=65){ printf("Grade: B"); }else if(totalMarks>=55){ printf("Grade: C"); }else if(totalMarks>=35){ printf("Grade: S"); }else{ printf("fail"); } return 0 ; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter