Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C programming failed...
#1
Hey guys I was learning c language then I dont know what's gone wrong here is my program
Code:
#include<stdio.h>
int main()
{
int m1,m2,m3,m4,m5,per;
printf("Enter the marks of five subjects\n");
scanf("%d%d%d%d%d",&m1,&m2,&m3,&m4,&m5);
per=(m1+m2+m3+m4+m5)/500*100;
if(per>=80)
printf("First Division\n");
else if(per>=60)
printf("Second Division\n");
else if(per>=50)
printf("Third Division\n");
else
printf("Fail");
return 0;
}
So now the problem is when I enter marks like 98,99,88,87,79. These are above 80% still it shows fail:mad: WHY??:confused:
[Image: 629965_101.png][Image: dav8ugf75d010z8vovm.gif]

Messages In This Thread
C programming failed... - by Danger255 - Nov 27 2012, 12:40 PM
RE: C programming failed... - by Spartacus - Nov 27 2012, 12:43 PM
RE: C programming failed... - by Danger255 - Nov 27 2012, 12:46 PM
RE: C programming failed... - by Spartacus - Nov 27 2012, 12:57 PM
RE: C programming failed... - by Danger255 - Nov 27 2012, 02:26 PM
RE: C programming failed... - by Spartacus - Nov 27 2012, 03:23 PM
RE: C programming failed... - by Danger255 - Nov 28 2012, 12:47 PM
RE: C programming failed... - by M. Bison - Nov 28 2012, 01:48 PM
RE: C programming failed... - by Spartacus - Nov 28 2012, 02:29 PM
RE: C programming failed... - by Dr. gkovr - Nov 28 2012, 07:18 PM
RE: C programming failed... - by Danger255 - Nov 29 2012, 12:23 PM
RE: C programming failed... - by M. Bison - Nov 29 2012, 01:38 PM
RE: C programming failed... - by Spartacus - Nov 29 2012, 02:40 PM
RE: C programming failed... - by Danger255 - Dec 01 2012, 10:25 AM
RE: C programming failed... - by M. Bison - Dec 03 2012, 04:07 AM
RE: C programming failed... - by Dr. gkovr - Dec 03 2012, 04:41 AM
RE: C programming failed... - by Danger255 - Dec 03 2012, 01:39 PM
RE: C programming failed... - by Spartacus - Dec 03 2012, 02:49 PM
RE: C programming failed... - by Danger255 - Dec 06 2012, 12:33 PM
RE: C programming failed... - by Leaky - Dec 24 2012, 03:41 PM
RE: C programming failed... - by Danger255 - Dec 24 2012, 03:43 PM

Users browsing this thread: 2 Guest(s)