Close sidebar

How will you print numbers from 1 to 100 without using loop?

We cannot use any loop, for, do while, while. Print without the use of loop?

  • Aditi
  • 5113 Views
  • 3 Answers
3 Answers
  • the print_numbers function calls itself with n - 1 until n reaches 0. When n is greater than 0, it prints the a rel='nofollow' href="https://geometrydash-lite.io"geometry dash lite/a after the recursive call, which ensures the numbers are printed in ascending order from 1 to 100.


  • Use recursion... void printno(int n) { if(n0) printno(n-1); printf("%d",n); }


  • simply you have to type the no by givings an array with capasity of more than 100 places which can stores the data .br / 

    -2

Practice Mock Test
c programming