#include<stdio.h>
#include<conio.h>
main()
{
int number[10], sum=0, i, max = 0;
float average;
clrscr();
for(i=0;i<10;i++)
{
printf("Please Enter Number %d : ",i+1);
scanf("%d",&number[i]);
}
printf("\n Sum of all Numbers : ");
for(i=0;i<10;i++)
{
sum += number[i];
}
printf("%d",sum);
printf("\n Average of all Numbers : ");
average = sum/10;
printf("%f",average);
printf("\n Maximum Number is : ");
for(i=0;i<10;i++)
{
if(max < number[i])
max = number[i];
}
printf("%d",max);
getch();
}
#include<conio.h>
main()
{
int number[10], sum=0, i, max = 0;
float average;
clrscr();
for(i=0;i<10;i++)
{
printf("Please Enter Number %d : ",i+1);
scanf("%d",&number[i]);
}
printf("\n Sum of all Numbers : ");
for(i=0;i<10;i++)
{
sum += number[i];
}
printf("%d",sum);
printf("\n Average of all Numbers : ");
average = sum/10;
printf("%f",average);
printf("\n Maximum Number is : ");
for(i=0;i<10;i++)
{
if(max < number[i])
max = number[i];
}
printf("%d",max);
getch();
}
0 Comments