#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num, i, arr[50], sum=0;
printf("How many number you want to enter ?");
scanf("%d",&num);
printf("\n Enter %d Numbers :",num);
for(i=1; i<=num; i++)
{
printf("\n Number %d=",i);
scanf("%d",&arr[i]);
sum=sum+arr[i];
}
int armean=sum/num;
printf("\n Arithmetic Mean = %d",armean);
getch();
}
Run:
Previous Next
#include<conio.h>
void main()
{
clrscr();
int num, i, arr[50], sum=0;
printf("How many number you want to enter ?");
scanf("%d",&num);
printf("\n Enter %d Numbers :",num);
for(i=1; i<=num; i++)
{
printf("\n Number %d=",i);
scanf("%d",&arr[i]);
sum=sum+arr[i];
}
int armean=sum/num;
printf("\n Arithmetic Mean = %d",armean);
getch();
}
Run:
Previous Next
No comments:
Post a Comment