Write A Program In "C" To Find Out The Sum And Average In 'N' Numbers?

2

2 Answers

Anonymous Profile
Anonymous answered
#include
int main()
{
long I,j,n,sum,average;
while(scanf("%ld",n)!=EOF)
{
for(I=0;I
Anonymous Profile
Anonymous answered
#include<stdio.h>#include<conio.h>main(){ int n,I,sum; float av; clrscr(); printf("nenter the value of n");
scanf("%d",&n); for(I=0;I<=n;I++) { sum=sum+I; } printf("n sum is: %d",sum); av=(float)sum/n; printf("nAverage is : %f",av); getch();}

Answer Question

Anonymous