C Programming Assignment Stating 3 Scanf Functions

Posted Under: C

Ask A Question
Viewed 18
For this assignment, create a C program that performs the following: Prompt the user to input 3 exam grades, use scanf to read in the values and store each in its own variable. Then use printf to display three lines with the labels “First exam:”, “Second exam:” and “Third exam:” each label should be followed by the score entered for said exam followed by a percent sign and a newline character. The exam scores should be aligned in the same column so that the output looks neat. In order to make the scores line up you should use “horizontal tab” escape sequences as necessary. Finally, you should create a separator line using dashes followed by a newline and then display to the user the average score followed by a percent sign. The average should also be aligned with the exam scores in the rows above it. Use appropriate data types to allow for decimals such as 91.5. Note: Calculating an average score requires an algorithm such as the following: (score1 + score2 + score3) / 3.0 The parentheses are important. An example of what the output might look like is below (user input is in red): Please enter three exam score: 75.5 92 100 First exam: 75.5% Second exam: 92% Third exam: 100% ----------------------------------- Average: 89.16666666666667%.

No uploads for this question

Explanations and Answers 0

No answers posted

Post your Answer - free or at a fee

Login to your tutor account to post an answer

Posting a free answer earns you +20 points.


NB: Post a homework question for free and get answers - free or paid homework help.

Get answers to: C Programming Assignment Stating 3 Scanf Functions or similar questions only at Tutlance.

Related Questions