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
Crazy boy [7]
3 years ago
13

Write a C program to compute the average age of nth student

Computers and Technology
1 answer:
Hitman42 [59]3 years ago
3 0

Answer:

Following are the code in c language

#include <stdio.h> // header file  

int main() // main function

{

 int n1,i;

 float avg,x,s=0; // variable declaration

printf("\nEnter How many Number terms you want:");

 scanf("%d",&n1); // input terms by user

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

{

 scanf("%f",&x); // user input

s= s +x; //calculate sum

}

avg = s/n1;// calculate average of n number

printf("\nThe average of n number is:");

 printf("%f",avg); // display average

return 0;

}

Output

Enter How many Number terms you want:3

3

4

3

The average of n number is:3.333333

You might be interested in
Sketch a 3-view orthographic projection of the object shown
vichka [17]

Answer:

Explanation:

/|_/]

6 0
3 years ago
Advantages and disadvantages of using the command-line interface to manage files and folders
EastWind [94]
Some advantages are that you will have more control, you can quickly access documents and files, and you can easily preform more advance commands. Some downside are not GUI, you have to know exactly what to type to do the action you need, and you have to experience error codes sometimes with will need you to google what they mean


Hope this helps! And I hope to get brainliest!
5 0
3 years ago
How do I write a program in Pascal that finds the index of the minimum number of an array(using Function) and replaces it to a n
nordsb [41]

Answer:

program arraysminfinder;

procedure minreplace();

var

no: array [1..10] of integer;  (*no is an array of integers, 10 in all *)

a: integer= 0;

i: integer= 0;

c: integer= 0;

k: integer=0;

N: integer=0;

begin

(* We need to first initialize the array no with 0 values *)

for a := 1 to 10 do

no[a]:=0;

c:=no[1];

for a := 1 to 10 do

begin

  if (no[i]<c) then

  begin

   c:=no[i];

   k:=i;

  end

  else

  begin

      i:=i+1;

  end

 end;

  writeln('Enter the new number:');

  read(N);

  no[k]:=N;

  for a := 1 to 10 do

  begin

     writeln('The array elements are:',no[a]);

   end;

end;

begin

end.

Explanation:

The program is as above.  I have used a function, a for loop, an array of integers, and the if then else ladder for getting the desired output as mentioned in the program. If in case you want procedure for input and output, create a procedure like:

procedure replacenum():integer;

Begin

 writeln("Enter the new number:" N);

    no[k]:=N;

   for a := 1 to 10 do

         writeln("The array elements are:"no[a]);

 end.

Similarly you can make a procedure for input.

5 0
4 years ago
Which image shows organic shapes? <br> A. image 1 <br> B. image 2 <br> C. image 3 <br> D. image 4
solniwko [45]
Image 3.

Hope this helps!!
4 0
3 years ago
Read 2 more answers
Select the correct answer.
Svetradugi [14.3K]

Answer:

C. Universal

Explanation:

7 0
3 years ago
Other questions:
  • What happened to Henry at the end of Chapter 4 in Bendy and the ink machine?
    9·2 answers
  • How do I cancel my subscription
    14·2 answers
  • What type of cable is used to connect a workstation serial port to a cisco router console port?
    15·1 answer
  • There are generally two ways of implementing dynamic programming solutions to problems, which have equal asymptotic time complex
    13·1 answer
  • Complete the below method, isPalindrome(), that takes in a String and returns a boolean. The boolean should be true if the Strin
    7·1 answer
  • Resize vector countDown to have newSize elements. Populate the vector with integers {newSize, newSize - 1, ..., 1}. Ex: If newSi
    6·1 answer
  • Is the color grade of black or white higher?
    11·2 answers
  • What is the difference between ionizing and non-ionizing radiation?
    7·2 answers
  • Create a class called StockTester that has the following fucntionality. a. Create a main method with an ArrayList named dataStoc
    9·1 answer
  • Cute nya diba I like bts army​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!