If and else and operators like this

PHOTO EMBED

Sun Apr 14 2024 06:17:05 GMT+0000 (Coordinated Universal Time)

Saved by @HTPrince

#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;
}
content_copyCOPY