Tuesday, 2 January 2018

C program to print numbers from 1 to 100 without using loop

#include<stdio.h>
int cal(int n);
int main( )
{
    printf("%d ",cal(1));

return 0;
}

int cal(int n)
{
    if(n==100)
      return n;

    printf("%d ",n);
    return cal(n+1);
}


No comments:

Post a Comment

Featured Post

TCS Latest Test Patern ( For On-Campus Drives )

Tata Consultancy Services is software services consulting company whose  headquarter is situated in Mumbai, India. It is the Asia’s larges...