Program to print reverse natural number from any number to n in C-language

#include<stdio.h>
int main()
{
    int i,n;
    printf("Enter the last natural number\n");
    scanf("%d",&n);
    printf("All reverse natural number from %d to 1 is\n",n);
    for(i=n;i>=1;i--)
    {
        printf("%d ",i);
    }
}

OUTPUT
Enter the last natural number
8
All reverse natural number from 8 to 1 is
8 7 6 5 4 3 2 1

Visit Homepage

Comments

Popular posts

Creative pattern of butterfly in C-language

Program to show present time and date in C-language

Introduction of C-language.

Program to cheque enter number is a perfect number or not using if else in C-language

Program to cheque four digits number is palindrome or not in C-language

Program to print the cube of a number in c-language

Simple Hello world program in c- language