Reverse for loop in C
Notes:
Reverse for loop in C Programming Language
- is a for loop in which counter variable is initialized with higher value , counter variable value is checked against the lower value and on every iteration counter variable value is decremented
Ex:
- Program to display 10 to 1
int i=0;
for(i=10; i>0; i--)
{
printf("%d\n",i);
}
- Program to display multiplication table for a given number in the reverse order
int i=0;
int num=2;
for(i=10; i>0;i--)
{
printf("%d x %d = %d\n",num,i, num*i);
}