[ create a new paste ] login | about

Link: http://codepad.org/9hkdX3Cz    [ raw code | output | fork ]

C, pasted on Feb 17:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int main()
{
 int sub1,sub2,sub3,total;
 printf("enter the marks in sub1,sub2,sub3");
scanf("%d%d%d", &sub1,&sub2,&sub3);
total=sub1+sub2+sub3;
printf("marks=%d",total);
if(total>100)
 printf("grade A");
if((total<100)&&(total>75))
 printf("grade B");
if((total<75)&&(total>50))
 printf("grade C");
else
 printf("grade D");

}


Output:
1
2
enter the marks in sub1,sub2,sub3marks=126522664grade Agrade D
Exited: ExitFailure 7


Create a new paste based on this one


Comments: