Print 1 to 10 without looping in C++

Source code :

#include<iostream.h>
#include<conio.h>

int j=0;
void print(int);
int main()
{
int a[10] ={1,2,3,4,5,6,7,8,9,10};
print(a[j]);
++j;
}

void print(int a)
{
if(j<10)
{
std::cout<<a<<"\t";
j++;
main();
}
}

Output :

0

Output :


                

Comments :