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;
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!