Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(b) Write a C program to read a student's name and three grades. These three grades are passed by reference to a void function named
(b) Write a C program to read a student's name and three grades. These three grades are passed by reference to a void function named rankStudentGrades. This function arranges the three grades in ascending order (places the smallest value in the first argument, then the second and the largest value in the third). Finally, the program displays the student name, grades in ascending order, and the average. You may define another function to calculate the average. Maximum two decimal points. You may use the swap function as discussed in the lecture. void swap(int *x, int *y) { int temp; temp = *X; * = *y; *y = temp; return; Example: User's input Enter student's name = James Bond Enter student's first grade = 92 Enter student's second grade = 78 Enter student's third grade = 86 Output James Bond 78 86 92 85.33
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started