1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
KengaRu [80]
3 years ago
5

Write a C program to show sum of 10 elements of array and show the average.

Computers and Technology
1 answer:
ipn [44]3 years ago
8 0

Answer:

// C program to find sum and average of 10 elements.

#include <stdio.h>

// main function

int main(void) {

   // array

double arr[10];

// variables

double average,sum=0;

int i;

   // ask to enter 10 elements of the array

printf("Enter 10 elements of the array:");

for(i=0;i<10;i++)

{

    // read elements of the array

    scanf("%lf", &arr[i]);

    // calculate the sum of elements

    sum=sum+arr[i];

}

// fint the average

average=sum/10;

// print sum

printf("Sum of 10 elements of the array is:%f ",sum);

// print average

printf("\nAverage of 10 elements of the array is:%f ",average);

return 0;

}

Explanation:

Create an array of size 10.Then read 10 values from user and store them into  array.Find the sum of 10 elements of the array and assign it to variable "sum". Find the average by dividing sum with 10.Print the sum and average.

Output:

Enter 10 elements of the array:3 2 4 5 1 4 8 9 12 10                                                                      

Sum of 10 elements of the array is:58.000000

Average of 10 elements of the array is:5.800000

You might be interested in
Which command must you use at the command prompt to determine the names of the network interfaces (including the isatap interfac
spayn [35]

ipconfig /all is operate at the command prompt to specify the names of the network interfaces (including the isatap interfaces) on a windows 7 computer.

<h3>What is Network interfaces?</h3>

A network interface exists the network-specific software that communicates with the network-specific device driver and the IP layer to furnish the IP layer with a consistent interface to all network adapters that might be present. The network interface may direct to Network interface controller, a computer hardware element that connects a computer to a computer network Network interface device, a device that functions as the demarcation.

config exists a console application program of some computer operating systems that shows all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol and Domain Name System settings.

Hence, ipconfig /all is operate at the command prompt to specify the names of the network interfaces (including the isatap interfaces) on a windows 7 computer.

To learn more about Network interfaces refer to:

brainly.com/question/20689912

#SPJ4

3 0
2 years ago
Sherry’s science teacher requires the use of an open access database . Which of the following meets the requirements
cestrela7 [59]
<h2>Answer:</h2>

<u>The correct option is </u><u>(D) Google</u>

<h2>Explanation:</h2>

Open access database refers to free, unrestricted online access to research outputs such as journal articles and books. Open Access content is open to all, with no access fees. Since Google provides its services free of cost and it is open to all of the people across the world therefore it can be considered as an Open Access database.

6 0
4 years ago
PLEASE HELP BRAINLIEST TO CORRECT ANSWER!!!
dsp73

Answer:

Blank #1 Meetup

Blank#2 MySpace

Explanation:

Blank# 1 Explanation

Meetup is a platform that enables to to seek out (or create!) local meetups. You mark your preferences when you register to this site. Meetup will then inform you of local meet ups that may concern you. The meetups cover a wide range of topics varying from technical issues, professional discussion to hobbies  etc. If you do not find topic of your interest, you may set up one and Meetup can inform relevant people who have marked your topic as something that interests them. It's a perfect platform to locally gather people with same interests.

Blank #2 Explanation

MySpace is a platform for social networking. It is a social networking website which offers an engaging, user network of friends, blog, personal profiles, forums, communities, images, songs, and videos.It used to be one of the largest social networking site in the world where people communicate and interact informally.

6 0
4 years ago
In c++ 11, the ________ tells the compiler to determine the variable's data type from the initialization value.
sergiy2304 [10]
<span>In describing an Initialization is when a value is assigned to a variable as part of the variable's definition or the assinged values to variables are defined whenever. 

The best answer would be is that they present the keyword,  when they tell the compiler.</span>
3 0
4 years ago
What kind of animation is used in the powerpuff girls show??
konstantin123 [22]
Calarts? Cartoon I don’t really know but that’s all the information that I have
8 0
3 years ago
Other questions:
  • The control programs managing computer hardware and software perform the _________ function to control and prioritize tasks perf
    8·1 answer
  • Which css property is used to change the text color of an element?
    15·1 answer
  • Consider the following class: public class Dog { private String name; private String breed; public String getName() { return nam
    11·1 answer
  • List the steps in setting up an online banking account
    12·2 answers
  • In this problem, you will fill in the code for a function count_digits(val) that takes a positive integer, val, and returns a li
    12·1 answer
  • This zyLab activity prepares a student for a full programming assignment. Warm up exercises are typically simpler and worth fewe
    8·1 answer
  • Find the errors<br><br> Look to the following code and fix the errors
    9·1 answer
  • Explain how you would set up a Demilitarized Zone on. You have 25 workstations and a server on your site. Explain what additiona
    5·1 answer
  • You are configuring NIC Teaming on a Windows Server system using two physical network adapters. You want to aggregate the bandwi
    10·1 answer
  • In python please.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!