How to print first 20 natural numbers?
#include <stdio.h>
#include <conio.h>
void main()
{
int i;
for (i = 1; i <= 20; i++)
{
printf("%d\n", i);
}
getch();
}
#include <conio.h>
void main()
{
int i;
for (i = 1; i <= 20; i++)
{
printf("%d\n", i);
}
getch();
}
Expected Output:-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Tags:
c by mskuthar
C Program to print first 20 natural numbers.
mskuthar
printing natural numbers
Using Do-While Loop
Using While Loop