Feb 2, 2013

Add of n number Program

/*Add of n number Program*/

#include"stdio.h"
#include"conio.h"
#include"math.h"
void main()
{
clrscr();
int i,n,average,sum=0;
printf("Enter the value of n=");
scanf("%d",&n);
for(i=1;i<=n;i++);
sum=sum+i;
average=sum/n;
printf("The Summation is=%d\n",sum);
printf("The Average is=%d",average);
getch();
}

No comments:

Post a Comment

Thank you for visit this site. You will get many programming news from here and learn programming very easily.

Popular Posts