C++ DEVELOPER SITE
PYTHONPHP7JAVA
 

print Pascal Triangle C++ Tutorial


Following is the program to print Pascal Triangle.

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

int main()
{
	int n,i,j,c,k,place;
	
	cout<<"Enter the no of rows: ">>endl;
	cin>>n;
	cout<<" \n\nPASCAL TRIANGLE">>endl;
	cout<<"\n\n";
	place=n;
		for(i=0;i=0;k--)
				cout<<" ";

				place--;
			for(j=0;j<=i;j++){
					cout<

Output

Enter number of rows: 5
          1                                                                         
       1    1                                                                        
    1     2    1                                                                      
  1    3    3    1                                                                      
1   4     6   4    1