fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void print(int n)
  5. {
  6. if(n==1)
  7. {
  8. cout<<n<<" ";
  9. return;
  10. }
  11. cout<<n<<" ";
  12.  
  13. return print(n-1);
  14. }
  15.  
  16. int main() {
  17. // your code goes here
  18. print(10);
  19. return 0;
  20. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
10 9 8 7 6 5 4 3 2 1