Skip to main content

Posts

Showing posts with the label Print Numbers from 'n' to 1 (for Loop)

C Program to Print Numbers from 'n' to 1 (for Loop)

In this easy coded program, you will learn how to print numbers from 'n' to 1 using for loop, where 'n' is taken from the user. You will have to take input of the first number that the user wants to print and simply write the code for its execution. --------------------------------------------------------------------------- Program to Print Numbers from 'n' to 1 (for Loop) /*Print Numbers from n to 1- for loop*/ #include<stdio.h> void main () {     int num;     printf( "Enter Number: " );     scanf( "%d" , & num);     for (; num >=1 ; num -- )     {         printf( "%d \t " , num);     } }   Enter Number : 7 7 6 5 4 ...