Flow

Number analysis program design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: the lowest number in the arraythe highest number in the array the total of the numbers in the arraythe...

Questions by pokhara

Showing Answers 1 - 1 of 1 Answers

Lohitha

  • Jul 30th, 2016
 

Code
  1. #include<stdio.h>

  2. int main()

  3. {

  4.         int a[20],i,min,max,count=0;

  5.         printf("enter elements into array:");

  6.         for(i=0;i<20;i++)

  7.         scanf("%d",&a[i]);

  8.         min=a[0];

  9.         for(i=0;i<20;i++)

  10.         {

  11.                 if(a[i]<min)

  12.                 min=a[i];

  13.         }

  14.         max=a[0];

  15.         for(i=0;i<20;i++)

  16.         {

  17.                 if(a[i]>max)

  18.                 max=a[i];

  19.                 count++;

  20.         }

  21.         printf("minimum value is:%d

  22. ",min);

  23.         printf("maximum value is:%d

  24. ",max);

  25.         printf("Number of elements in an aray:%d

  26. ",count);

  27.         return 0;

  28.        

  29. }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions