Interview Questions   Tutorials   Discussions   Programs   

C - Write a c program to print 1 to 100 without using loops?




436
views
asked marvit August 21, 2014 09:30 AM  

Write a c program to print 1 to 100 without using loops?


           

1 Answers



 
answered By bhjahnavi   0  
/*program for numbers from 1 to 100 without using loops*/
#include<stdio.h>

int main()
{
  int num = 1;

  func(num);

  return 0;
}
int func(num)
{
  if(num<=100)
  {
     printf("%d ",num);
     func(num+1);
  }
}
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert