write an algorithm summation of number by using while loop in c program
Answers
Answered by
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
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