# include<stdio.h>
# include<conio.h>
void main()
{
int arr[10];
int i,sum=0,avg=0;
clrscr();
for(i=0;i<10;i++)
{
scanf("%d",&arr[i]);
sum = sum + arr[i];
}
printf("\n Sum of array elements = %d",sum);
avg = sum/10;
printf("\n Average = %d",avg);
getch();
}
# include<conio.h>
void main()
{
int arr[10];
int i,sum=0,avg=0;
clrscr();
for(i=0;i<10;i++)
{
scanf("%d",&arr[i]);
sum = sum + arr[i];
}
printf("\n Sum of array elements = %d",sum);
avg = sum/10;
printf("\n Average = %d",avg);
getch();
}
Explained about array concepts very nicely thanks for sharing
ReplyDeleteAngular course