Computer Science, asked by mathewvaidyan23041, 2 months ago

Write c program square of natural numbers using do while loop

Answers

Answered by askwhywhatwhen
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