Recursive or not?

I was trying the Pascal's Triangle using Recursion and it runs perfectly fine but then I realised that I have also used Loops in my Recursive program, so I would really appreciate if you guys could just go through my program below and let me know whether it can be termed as 'Recursive' or not? Thanks!

#include<iostream.h>
Using namespace std;

PrintPascal(int a)
{
if (a==1)
cout<<a<<endl;

else
{
PrintPascal(a-1);

for(int i=1; i<=a; i++)
cout<<i<<" ";

for(int z=(a-1); z>0; z--)
cout<<z<<" ";

cout<<endl;
}
}
int main()
{
int n;
cout<<"Enter Number of Rows : ";
cin>>n;

PrintPascal(n);
return 0;
}
If a function calls itself, it is recursive. Whether that same function contains a loop or not is immaterial.
> I was trying the Pascal's Triangle using Recursion and it runs perfectly fine
weird... your code doesn't compile

the header is just `iostream'
using
missing return type in PrintPascal()


After fixing that, the output is not Pascal's Triangle


Also, http://www.cplusplus.com/forum/beginner/126077/
Oops sorry, i m accessing this site using my cellphone so i guess i screwed it up while copying the code from the system other than that thanks for your help...i got my answer!
Topic archived. No new replies allowed.