Preview:
#include <stdio.h>

int main (){
    
    int index;
    int mark1;
    int mark2;
    
    printf("Enter index number :");
    scanf("%d",&index);
    
    printf("Enter mark1 :");
    scanf("%d",&mark1);
    
    printf("Enter mark2 :");
    scanf("%d",&mark2);
    
    int avg = (mark1+mark2)/2;
    printf("Average of marks :%d\n",avg);
    
    if(avg>=35){
        printf("Grade = c");
    }else{
        printf("fail");
    }

    return 0;
}
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