// Video demonstration is on youtube : https://www.youtube.com/watch?v=9Wp_HUGJY-o
//Here is the program:
#include"stdio.h"
#include"conio.h"
void main()
{
void print_num(int);
void print_num_rev(int);
print_num(10);
printf("\n");
print_num_rev(10);
}
void print_num_rev(int n)
{
if(n<1)
return;
print_num_rev(n-1);
printf("%d,",n);
}
void print_num(int n)
{
if(n<1)
return;
printf("%d,",n);
print_num(n-1);
}
//Here is the program:
#include"stdio.h"
#include"conio.h"
void main()
{
void print_num(int);
void print_num_rev(int);
print_num(10);
printf("\n");
print_num_rev(10);
}
void print_num_rev(int n)
{
if(n<1)
return;
print_num_rev(n-1);
printf("%d,",n);
}
void print_num(int n)
{
if(n<1)
return;
printf("%d,",n);
print_num(n-1);
}
No comments:
Post a Comment