Hi, I need help with this C programming question. Thanks a lot

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 16RQ
icon
Related questions
Question
100%

Hi,

I need help with this C programming question.

Thanks a lot 

1.
The following code is for calculating the mean value of 6 grades and has five
errors/warnings. Identify and correct the errors/warnings.
1
#include <stdio.h>
2
3
#define SIZE 6;
4
double mean Value (int grades [] , size_t size)
7
int main (void)
8
{
10
int grades []
{98, 87, 92, 67, 74, 88};
11
12
double average;
13
14
average = meanValue (grades, SIZE);
15
16
printf ("Mean value of grades is %.2d\n", average);
17
18
19
20
double mean Value (int grades [] , int size)
21
{
22
int total = 0;
23
for (size t i = 0; i < size; i++) {
total += grades [i];
24
25
26
}
27
28
return total/size;
29
30 }
Transcribed Image Text:1. The following code is for calculating the mean value of 6 grades and has five errors/warnings. Identify and correct the errors/warnings. 1 #include <stdio.h> 2 3 #define SIZE 6; 4 double mean Value (int grades [] , size_t size) 7 int main (void) 8 { 10 int grades [] {98, 87, 92, 67, 74, 88}; 11 12 double average; 13 14 average = meanValue (grades, SIZE); 15 16 printf ("Mean value of grades is %.2d\n", average); 17 18 19 20 double mean Value (int grades [] , int size) 21 { 22 int total = 0; 23 for (size t i = 0; i < size; i++) { total += grades [i]; 24 25 26 } 27 28 return total/size; 29 30 }
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Structure chart
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage