subject

Hello, i am actually begginer in C language so need some help about it. I am making a program in which i take 3 subjects and take input of that from User. After that i find percentage of each subject depend upon marks i enter and then i try to find Total percentage of 3 subject(Main Goal) but the total percentage i get is not right i am getting. I am putting everything right. I am entering 20 marks for each subject. so total 60 of all 3 subjects. Now my question is
1st: Kindly check the code and let me know why i am getting 46.6 something instead of 21.8 something percentage(Found using calculator)
#include

int main()
{
float ObtainedPhysicsNumber, ObtainedMathsNumber, ObtainedEnglishNumber;
int TotalPhysicsNumber, TotalMathsNumber, TotalEnglishNumber, TotalSubjectNumbers;
float PhysicsPercentage, MathsPercentage, EnglishPercentage, TotalPercentage;

printf("Your Physics Number is\n");
scanf("%f", &ObtainedPhysicsNumber);

printf("Your Maths Number is\n");
scanf("%f", &ObtainedMathsNumber);

printf("Your Urdu Number is\n");
scanf("%f", &ObtainedEnglishNumber);

// Subject Total Number
TotalPhysicsNumber = 100;
TotalMathsNumber = 100;
TotalEnglishNumber = 100;
// Total Subject numbers
TotalSubjectNumbers = TotalPhysicsNumber + TotalMathsNumber + TotalEnglishNumber;
printf("Total Subject Numbers is %d\n", TotalSubjectNumbers);
// Percentage of each subject

PhysicsPercentage = ObtainedPhysicsNumber / TotalPhysicsNumber * 100;
printf("Your Physics percentage is %f\n", PhysicsPercentage);

MathsPercentage = ObtainedMathsNumber / TotalMathsNumber * 100;
printf("Your Maths Percentage is %f\n", MathsPercentage);

EnglishPercentage = ObtainedEnglishNumber / TotalEnglishNumber * 100;
printf("Your Urdu Percentage is %f\n", EnglishPercentage);

//Calculating Total Percentage
TotalPercentage = ObtainedMathsNumber + ObtainedPhysicsNumber + ObtainedEnglishNumber / TotalSubjectNumbers * 100;
printf("Total Percentage is %f\n", TotalPercentage);

return 0;
}
Output i get is after entering Physics, Maths and Urdu number
Your Physics Number is
20
Your Maths Number is
20
Your Urdu Number is
20
Total Subject Numbers is 300
Total Percentage is 46.666668

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
Rachel completed typing an official document with a word processing program. she wants to make sure that her document has no typographical errors. she also wants all headings to have the same font. which features in a word processing program should she use? rachel should use the feature in a word processing program to find typographical errors. she should apply to have uniform headings.
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
question
Computers and Technology, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
question
Computers and Technology, 24.06.2019 16:00
Which of the following characters is acceptable to use in a filename? ? / – %
Answers: 1
You know the right answer?
Hello, i am actually begginer in C language so need some help about it. I am making a program in whi...
Questions
question
Spanish, 02.04.2021 20:00
question
Mathematics, 02.04.2021 20:00
question
Social Studies, 02.04.2021 20:00
question
Mathematics, 02.04.2021 20:00
Questions on the website: 13722363