Here is my code for pascal triangle problem:
#include<bits/stdc++.h>
using namespace std;
int main(){
int n ;
for (int i = 0; i < INT_MAX ; i++)
{
cin >> n ;
if (n <= 10){
break;
}
else
{
cout << “Enter no less than 10” << endl ;
}
}
for (int i = 0; i < n; i++)
{
for (int space = n-1 ; space > i; space --)
{
cout<<" ";
}
int c = 1 ;
cout << "1 " ;
for ( int j = 1; j <= i ; j++)
{
c = c*(i-j+1 )/(j);
cout <<c<< " ";
}
cout << endl;
}
}