Program to print counting 10 to 1 using recursion

#include<iostream.h>
#include<conio.h>
void myfuntion(int);
void main()
{
clrscr();
myfuntion(10);
}
void myfuntion(int counter)
{
if(counter==0)return;
else
{
cout<<"\ncounter= "<<counter;
myfuntion(--counter);
return;
}
}

No comments

Powered by Blogger.