Home

A program to print natural numbers between 1 and 10 in reverse order

C Programming Language 037

The following code shows how to write a program to print natural numbers between 1 and 10 in reverse order.

Program

#include <stdio.h>

void main()
{
    int i;

    for (i = 10; i >= 1; i--)
    {
        printf("%d\n", i);
    }

    printf("\n");
}

Result

10
9
8
7
6
5
4
3
2
1


Last Updated on

Next Post: GraphProtocol: TS2322 null assignment in Subgraph →

Comments