Computer Science, asked by sf21622, 6 hours ago

write an algorithm summation of number by using while loop in c program​

Answers

Answered by MoonBlaze
0

Answer:

Using while Loop

#include <stdio.h>

#include <conio.h>

void main()

{

int num, i, sum = 0; // initialize and declare the local variables.

printf("Enter a positive number : ");

scanf("%d", &num); // take a value up to which find the sum of n natural number.

i = 0;

Answered by MissIncredible34
1

Explanation:

Using while Loop

  • #include <stdio.h>
  • #include <conio.h>
  • void main()
  • {
  • int num, i, sum = 0; // initialize and declare the local variables.
  • printf("Enter a positive number : ");
  • scanf("%d", &num); // take a value up to which find the sum of n natural number.
  • i = 0;
Similar questions