Program in c to print 1 to 100 numbers without using loop

This c program example demonstrate that how to print 1 to 100 without using any loop in c program. In this program actually function called itself each and every time. So we can also called this program as program of recursive function.

C program to print 1 to 100 without any loop.
#include<stdio.h>

void main()
{

int no=1;
clrscr();
print(no);

getch();

}

int print(no)
{
if(no<=100)
{
printf("%d ",no);
print(no+1);
}

}


C program to print 1 to 100 number without using loop

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.