Become Our Fan on Social Sites!

Facebook Twitter

Google+ RSS YouTube

Thursday 26 September 2013

Program to print numbers from 1 to 100 without using loops

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 );
    }
}

0 comments :

Post a Comment