#include<stdio.h>
#include<conio.h>
void main()
{
void n();
clrscr();
n();
getch();
}
void n()
{
int a,i;
float av,sum;
printf("\n Enter the value of a");
scanf("%d",&a);
for(i=1;i<=a;i++)
{
sum=sum+i;
}
printf("\n sum is:%f",sum);
av=sum/a;
printf("\n avg is :%f",av);
getch();
}
No comments:
Post a Comment