• Print 1 to 100 without using loop in c
  • We print 1 to n numbers without using any loop.
  • By using recursive function in C Programming we can print 1 to 100 or 1 to n numbers.
  • Now We will write a C program to print one to 100 without using any loops.
  • Print 1 to 100 without loop and recursion



 Program #1: Write a C program to print 1 to 100 without loop and using recursive function.


  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int print(int num);
  4. int main(int argc, char *argv[])
  5. {
  6.     int number = 1;
  7.  
  8.     print(number);
  9.  
  10.    return 0;
  11. }
  12. int print(int number){
  13.     if(number<=100){
  14.          printf("%d ",number);
  15.          print(number+1);
  16.     }
  17. }
   
Output:


print 1 to 100 in c

Instance Of Java

We will help you in learning.Please leave your comments and suggestions in comment section. if you any doubts please use search box provided right side. Search there for answers thank you.
«
Next
Newer Post
»
Previous
Older Post

No comments

Leave a Reply

Select Menu