Sum of N numbers program in C: Using While Loop

Let’s discuss the program for sum of N numbers in C Programming Language using the While Loop.

C Program to find Sum of N Numbers using While Loop

//Learn C Programming at
int main()
  int Num, i = 1, Sum = 0;
    printf("\nEnter any Integer Value\n");
  scanf("%d", &Num);
  while(i <= Num)
     Sum = Sum + i;
  printf("Sum of N Numbers = %d", Sum);
  return 0;

Leave a Comment

Your email address will not be published. Required fields are marked *