Tech Study

C Program To Print All Natural Numbers In Reverse Order

Introduction

Write a C program to print all natural numbers in reverse order

#include <stdio.h>

int main()
{
    int i, num;

    //Read a number from user
    printf("Enter any number: ");
    scanf("%d", &num);

    /*Running loop from the number entered by user,
      and Decrementing by 1*/
    for(i=num; i>=1; i--)
    {
        printf("%d\n", i);
    }
    return 0;
}

Result

Write a C program to print all natural numbers in reverse order
Write a C program to print all natural numbers in reverse order

Write C program to print multiplication table of a given number

write a c program to print sum of digits

TaggedWrite a C program to print all natural numbers in reverse order

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more