What is the output of the c code given below.
#include
float fun c(float age[]);
int main()
{
float result, age[]={23.4,55,22.6,3,40.5,18};
result=fun c(age);
printf("%0.2f",result);
return 0;
}
float func(float age[])
{
int i;
float result, sum=0.0;
for (i=0;i<6;++i){
sum+=age[i];
}
result=(sum/6);
return result;
}
a)27.08
b)27.083334
c)compiler error as result is declared twice
d)error: invalid prototype declaration
Answers
Answered by
2
Answer:-
B. 27.083334
EXPLANATION:-
As control move to func();
sum of all age =165.5
so, result=165.5/6
===>27.083334
hope it's help.
please mark as brainlist ☺️
Similar questions
Science,
4 months ago
English,
4 months ago
Math,
9 months ago
Accountancy,
1 year ago
Math,
1 year ago