Following program prints numbers from 1 to 100 without using loops
#include<stdio.h>
void print_num(int);
int main()
{
int no = 1;
print_num(no);
return 0;
}
void print_num( no )
{
if( no <= 100 )
{
printf("%d ", no);
print_num( no + 1 );
}
}
void print_num(int);
int main()
{
int no = 1;
print_num(no);
return 0;
}
void print_num( no )
{
if( no <= 100 )
{
printf("%d ", no);
print_num( no + 1 );
}
}
0 comments :
Post a Comment