#include<stdio.h> int main(){ int a; int b; int c; printf("Enter value for a:"); scanf("%d",&a); printf("Enter value for b:"); scanf("%d",&b); c = (a+b)/2; //printf("Enter value for c:"); //scanf("%d",&c); if(a==b){ printf("\na equal to b\n"); }else{ printf("a is not equal to b\n"); } if(a<b){ printf("a smaller than b\n"); }else{ printf("a larger than b\n"); } if(a>b){ printf("a is big"); }else{ printf("b is big\n"); } if (c>=85){ printf("Exellent you have A+ "); }else if(c>75){ printf("Grade: A"); }else if(c>65){ printf("Grade: B"); }else if(c>55){ printf("Grade: C"); }else if(c>40){ printf("Grade: S"); }else{ printf("You are fail idiot.!\nYou have Grade:W for that"); } printf("\n%d",c); 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