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 01:30
How will you cite information that is common knowledge in your research paper?
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
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
Mathematics, 09.12.2021 04:10
question
Mathematics, 09.12.2021 04:10
Questions on the website: 13722361