output : all numbers to be printed between start and end number
Implemented methods:
using recursion:
#include
Void NumberPrinter(int ,int );
void main()
{
int iStartNo,iEndNo;
printf("Enter the Start and End numbers: ");
scanf("%d,%d",&iStartNo,&iEndNo);
NumberPrinter(iStartNo,iEndNo);
}
void NumberPrinter(int iStartNo,int iEndNo)
{
if(iStartNo
return ;
printf("%d ",iStartNo++);
NumberPrinter(iStartNo,iEndNo);
}
No comments:
Post a Comment