Adding of n numbers using for loop
#include<stdio.h>
int main()
{
int i,j,m,n,sum=0;
printf("enter the number :");
scanf("%d",&n);
printf(" enter %d integer",n);
for(i=0;i<n;i++)
{
scanf("%d",&m);
sum=sum+m;
}
printf("the sum of the entered number is = %d",sum);
}
Comments
Post a Comment