RECURSION DISPLAY NATURAL NUMBER

#include<stdio.h>
#include<conio.h>
void num(int x);
void main()
{
int r,n=1;
clrscr();
num(n); //call
getch();
}

void num(int x)
{
      if(x<=5) 
      {
       printf("\t%d ",x); 
       x++;
       num(x); ///call  
      }

}

No comments:

Post a Comment

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II :   1) Which of the following is the extension of Not...