Calculation
Jul 15, 2016 at 4:40pm UTC
i was making a software to calculate marks of students and their percentage and total marks but i think there is some problems in my code please correct them!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
int main()
{
textcolor(RED);
textbackground(WHITE);
clrscr();
printf("Here You Can Check Your Results \n kindly write your numbers bellow \n" );
int math,phy,chem,total; float re;
printf("\n Your Maths Marks:" ); scanf("%d" , math);
printf("\n Your Physics Marks: " ); scanf("%d" , phy);
printf("\n Your Chemistry Marks:" ); scanf("%d" , chem);
printf("\n Total:" ); total=math+phy+chem;
printf("\n Percentage:" ); re=100/400*100;
return 0;
}
Jul 15, 2016 at 6:26pm UTC
Line 20: You're not including total in your calculation.
Topic archived. No new replies allowed.