Question

C Programming: Write a C program that processes an array of 10 numbers, calculates the average...

C Programming:
Write a C program that processes an array
of 10 numbers, calculates the average of their square roots, and prints it out.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE IN C:

#include <stdio.h>
#include<math.h>

int main()
{
int arr[10];
printf("Enter 10 numbers:");
int i ;
for(i = 0 ; i < 10 ; i++){
scanf("%d", &arr[i]);
}
float total = 0 ;
for(i = 0 ; i < 10 ; i++){
total += sqrt(arr[i]);
}
float avg = total / 10 ;
printf("Average of square roots of your array numbers : %.2f", avg);

return 0;
}

OUTPUT:

Add a comment
Know the answer?
Add Answer to:
C Programming: Write a C program that processes an array of 10 numbers, calculates the average...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT