English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

1.Write a loop that computes the average of the array entries.
2.Write a function that returns the largest entry of an array.
3.Sort an array either in inceasing or decreasing fashion, whichever the user specifies.
4.Write a function that tests if two arrays have the same entries (even if not in the same order).

2006-12-08 01:55:02 · 5 answers · asked by samosaki 1 in Computers & Internet Programming & Design

5 answers

do your own homework.

2006-12-08 02:07:50 · answer #1 · answered by huskerbidwatcher 3 · 1 0

which you will fetch the enter employing an worry-unfastened loop that is going from a million to n, or from 0 to n - a million. by employing employing certainty you in elementary terms could prefer to save the mind-blowing numbers, you will could prefer to substantiate inspite of if or now no longer each entered extensive style is elementary. a marvelous quantity has least confusing itself and a million as reasons. to seem at inspite of if or now no longer it has distinctive reasons, use a loop and the modulus operator. The modulus operator returns the the the the remainder of branch. as an social collecting: 10 % 5 = 0 as quickly as you think of approximately that 5 is going into 10 2 situations with a the the remainder of 0. 7 % 2 = a million thinking the easy certainty that 2 is going into 7 3 activities with a the the remainder of one million. If we've m % n, the effect ought to be 0 if n is a element of m and something incredibly than 0 if n isn't a element of m. To print the array of primes, in basic terms use one greater loop.

2016-12-18 09:50:39 · answer #2 · answered by ? 3 · 0 0

1. s:=0;
for i=1 to n do
s:=s+a[i];
average=s/n;
2. function max(a:array, n:integer): integer;
var m,i:integer;
begin
m:=a[1];
for i:=2 to n do
if a[i]>m then m:=a[i];
max:=m;
end;
................. i'll leave the rest to others

2006-12-08 02:01:13 · answer #3 · answered by forever 2 · 0 0

What language do you want it in? There are so many it is hard to guess

2006-12-08 02:08:20 · answer #4 · answered by Elizabeth Howard 6 · 0 0

for (int i=0;i<6;i++)
{
arry[i]=i


System.out.println(arry[i])

}

2006-12-08 02:21:00 · answer #5 · answered by STUDENT 1 · 0 0

fedest.com, questions and answers