Write c program square of natural numbers using do while loop
Answers
Answered by
1
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;
Similar questions
English,
1 month ago
Physics,
1 month ago
Computer Science,
2 months ago
History,
9 months ago
Science,
9 months ago
Computer Science,
9 months ago