Write the Javascript Coding to enter 2 numbers , print the sequence of numbers between them in reverse order
Answers
Answered by
0
Answer:
Explanation: Run a loop from N to 1 and print the value of N for each iteration. Decrement the value of N by 1 after each iteration.
Below is the implementation of the above approach.
filter_none
edit
play_arrow
brightness_4
// C++ program to print all numbers between 1
// to N in reverse order
#include <bits/stdc++.h>
using namespace std;
// Recursive function to print from N to 1
void PrintReverseOrder(int N)
{
for (int i = N; i > 0; i--)
cout << i << " ";
}
// Driven Code
int main()
{
int N = 5;
PrintReverseOrder(N);
return 0;
Similar questions
Math,
3 months ago
Math,
8 months ago
CBSE BOARD X,
8 months ago
Math,
1 year ago
Computer Science,
1 year ago