ArcMedia JavaScript Source Code 3000 Pro (gar448) for PC Logo

Related Topics:

Posted on Mar 18, 2009
Answered by a Fixya Expert

Trustworthy Expert Solutions

At Fixya.com, our trusted experts are meticulously vetted and possess extensive experience in their respective fields. Backed by a community of knowledgeable professionals, our platform ensures that the solutions provided are thoroughly researched and validated.

View Our Top Experts

A Program using an array that culculates the sum and average of the five input values?

1 Answer

Anonymous

Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

Sergeant:

An expert that has over 500 points.

Champion:

An expert who has answered 200 questions.

  • Expert 219 Answers
  • Posted on Mar 31, 2009
Anonymous
Expert
Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

Sergeant:

An expert that has over 500 points.

Champion:

An expert who has answered 200 questions.

Joined: Mar 23, 2009
Answers
219
Questions
0
Helped
59866
Points
554

Hi,
I am writing in C code here
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,sum=0;
float avg=0;
printf("enter the five values");
for(i=0;i<5;i++)
scanf("%d",&a[i]);
for(i=0;i<5;i++)
sum+=a[i];
printf("Sum=%d",sum);
avg=sum/5;
printf("Average=%f",avg);
getch();
}

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

0helpful
1answer

How program to compute the average for any number students ?

The easiest way is to add a field, name it attendance or something and assign a value of one. Then sum column a / sum column b for average.
0helpful
1answer

I need to find the mean of 6 6 11 and 12 and i don't now what to divide by.

Mean=Average =(Sum of data values)/(number of data in set)
Sum of data values =6+6+11+12=35
Number of data =4
Average =Mean =35/4=8.75
0helpful
1answer

Write a program c that declares an array of 100 elements to hold these values. Read the values in from the file and store them in successive elements of the array. Keep track of how many numbers are read...

That appears to be an intermediate question in a programming class. Best read the book, the answer is not what is important the process of getting the answer is what you are trying to learn.
1helpful
1answer

Declare 2 arrays with 5 as index value of each. the user will input values to the first array(user-defined). Transfer value of the first array to the second array.Get the sum of the second...

You could do this by creating two arrays as such:
int firstArray[5]; int secondArray[5]
and then the sum variable:
int sum = 0;
then you could do a for loop to find the sum of the second array:
1helpful
2answers

C++ poker program

Hi.

I suggest creating an Array of Cards (cardOne,cardTwo,etc. to five)

If you can enter them in one at a time, after declaring the array, assign the values to the array.

cin < cardOne; (Psuedo code by the way, hope you don't mind)

Afterwards, you'll have an array with 5 cards.

Declare what full houses, flushes, etc would require.
Use an if statement (If you don't mind lots of code) to compare the entered Array against possible hands.

I didn't necessarily give you any specific C++ code. However, if you Google C++ user input, you should find plenty of commands that may help you.

Good Luck

(And not sure about Linear search to be honest, you can use a Linear search, but if you did it the way I explained, you just have to compare hand to a series of conditionals.)


0helpful
1answer

How to compute a class average using arrays

hi, here is the program #include<stdio.h> #include<conio.h> void main() { int class[30],i; float sum=0,avg=0; printf("enter marks"); for(i-0;i<30;i++) scanf("%d",&class[i]); for(i-0;i<30;i++)
sum+=class[i]; avg=sum/30; printf("%f",avg); getch(); }
0helpful
1answer
0helpful
2answers

Excel will not displaying the results of a trend array formula

Hi Griffnz,

Your "known Y's" or 'values' are in Column B. This is the first array in the Trend formula.

Your "known X's" or 'months' are in Column A. This is the second array in the trend formula.

The trend formula is supposed to give you a projection of what the rest of the values in Column B will be over the next few months (usually continuing cells in Column A). The cells you want these values to show up in represent the third array in the formula.

Thus, your formula should look more like: '=trend(B3:B14,A3:A14,A15:A18)'

However, your formula is leaving out The values in B and adding values from C - -- but there ARE no values in C. Apparently, C is where you want the values to appear. In that case, the C array would be the third array in your formula. This would look more like '=trend(B3:B14,A3:A14,C3:C14)

If this doesn't make sense, let me know.
0helpful
1answer

Pls. help me

Q.2#  Dim n, sum as Double
Dim i as Integer
n=100
sum=0

for i=1 to n
sum=sum+1/n
next i

Q.3#  Dim sum as Double
sum=0
for i=1 to 99
if i%2 <> 0 then sum=sum+i end if
next i
Not finding what you are looking for?

138 views

Ask a Question

Usually answered in minutes!

Top ArcMedia Computers & Internet Experts

Rob Hill
Rob Hill

Level 3 Expert

1480 Answers

 Mikey
Mikey

Level 3 Expert

6903 Answers

Are you an ArcMedia Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...