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.
---------------------------------------------------------------------------
Hope you found this 'C Program to Print Numbers from 'n' to 1 (for Loop)' easy, simple and helpful!
Try to solve more queries by yourself by referring more examples from BEGINC. Here you will get the most easiest code to each and every query. Keep practicing. More programs are coming.
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 3 2 1
---------------------------------------------------------------------------Hope you found this 'C Program to Print Numbers from 'n' to 1 (for Loop)' easy, simple and helpful!
Try to solve more queries by yourself by referring more examples from BEGINC. Here you will get the most easiest code to each and every query. Keep practicing. More programs are coming.
Comments
Post a Comment
Please do not comment any spam links in the comment box.