write a program to  store 10 numbers in array and find out sum, maximum and average of these 10 numbers.

 

Answer :

i will just give you the source code in C...since you havent mentioned which programming language you want it in...


#include <stdio.h>
#include <ctype.h>
int main(){ 
   int i;   
int number[10];   
int n;   
int x;   
int j;   
int temp; 
 printf("Type number of elements:"); 
scanf("%d",n); 
 for(i=0;i<n;i++){ 
  printf("Enter element %d:",i+1); 
 scanf("%d",&number[i]);}    
   for(i=0;i = n-i;i++)   {     
       x=0;             
for(j=0;j<n-1-i;j++)             {                           
  if (j >j+1)      {       
 temp = j;        j = j+1;       
number[j+1]= temp;       
 x++;}}   }     
 getchar();   
 getchar();       
 return(0);   
 }

Other Questions