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, 23.06.2019 02:30
Which component acts as a platform on which application software runs
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
Where can page numbers appear? check all that apply. in the header inside tables in the footer at the bottom of columns at the top of columns
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
1. web and mobile applications allow users to be actively engaged in an online activity. a true b false 2. some examples of business applications purposes are to collaborate, share files, meet virtually in real-time, and accept payments. a true b false 3. an education application would most likely do which of the following? a allow users to watch popular movies and tv shows b connect users with social and business contacts c confirm users' travel plans d teach users a new language 4. a uniform resource locator (url) is how the internet knows where to take users when an address is typed into a browser. a true b false 5. deon is required to provide the citation information for his sources. what type of information should he collect from his sources? a author name, title, date of publication, date of access, url b connections to background information c interesting facts and statistics d notes on important information
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
Iam trying to get my google account back for school and business, can someone ?
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
Social Studies, 23.02.2021 01:00
question
Mathematics, 23.02.2021 01:00
question
Mathematics, 23.02.2021 01:00
question
Law, 23.02.2021 01:00
question
Mathematics, 23.02.2021 01:00
Questions on the website: 13722361