C Program that Print First 10 Natural Numbers using For, While and Do-While Loop
###### Posted by Samath
Last Updated: January 02, 2017

Write a C Program that Print First 10 Natural Numbers using For, While and Do-While Loop.

A natural number is a number that occurs commonly and obviously in nature. As such, it is a whole, non-negative number. The set of natural numbers, denoted N, can be defined in either of two ways:

N = {0, 1, 2, 3, ...}

N = (1, 2, 3, 4, ...}

Using For Loop:

```#include<stdio.h>

int main() {
int i = 1;

for (i = 1; i <= 10; i++) {
printf("%d", i);
}
return (0);
}```

Using While Loop:

```#include<stdio.h>

int main() {
int i = 1;

while (i <= 10) {
printf("%d", i);
i++;
}

return (0);
}```

Using Do-While Loop:

```#include<stdio.h>

int main() {
int i = 1;

do {
printf("%d", i);
i++;
} while (i <= 10);

return (0);
}```

###### Find factorial using loop in C++
Samath | Nov 02, 2014
###### Java program that uses a loop to compute the sum of all even numbers between 2 and 100 (inclusive)
Samath | Apr 03, 2022
###### Javascript program that check if a word is palindrome using one for loop
SceDev | Feb 17, 2024
###### Java program that uses a loop to compute the sum of all squares between 1 and 100 (inclusive)
Samath | Apr 03, 2022
###### Java program that uses a loop to compute the sum of all even numbers between a and b (inclusive), where a and b are inputs
Samath | Apr 03, 2022
###### Java program that uses a loop to compute the sum of all odd digits of an input. (For example, if the input is 32677, the sum would be 3 + 7 + 7 = 17.)
Samath | Apr 03, 2022