Ex. ภาษาซี if else

#include<stdio.h>
#include<conio.h>
int main(){
int a,b,c,s;
char g;
scanf(“%d%d%d”,&a,&b,&c);
s =a+b+c;
if(s>=80) {printf(“A”);}
else if(s>=75){printf(“B+”);}
else if(s>=70){printf(“B”);}
else if(s>=65){printf(“C+”);}
else if(s>=60) {printf(“C”);}
else if(s>=55){printf(“D+”);}
else if(s>=50){printf(“D”);}
else {printf(“F”);
}
getch();
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s