Learn Implement Achieve
Let’s discuss the program for sum of N numbers in C Programming Language using the While Loop.
int Number, i, Sum = 0;
printf("\nPlease Enter any Integer Value\n");
for(i = 1; i <= Number; i++)
Sum = Sum + i;
printf("Sum of Natural Numbers = %d", Sum);
Your email address will not be published. Required fields are marked *
Save my name, email, and website in this browser for the next time I comment.
Notify me of follow-up comments by email.
Notify me of new posts by email.