C Program to print first 20 natural numbers.

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();
}

Expected Output:-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Using While Loop

Post a Comment

Previous Post Next Post