Program to print numbers from N to 1 in reverse order | C ++ program to print all numbers between 1 to N in reverse order ; Recursive function to print from N to 1 ; if N is less than 1 then return void function ; recursive call of the function ; Driven Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void PrintReverseOrder ( int N ) { if ( N <= 0 ) { return ; } else { cout << N << " ▁ " ; PrintReverseOrder ( N - 1 ) ; } } int main ( ) { int N = 5 ; PrintReverseOrder ( N ) ; return 0 ; }