2dix-The Student Choice
Log in Register now

C++ Program of PASCAL’S TRIANGLE

Write a Program of PASCAL’S TRIANGLE

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

void main()
{
int line,i,j,k;
clrscr();
printf("Enter the no. of lines");
scanf("%d",&line);
for(i=1;i<=line;i++)
{
for(j=1;j<=line-i;j++)
printf(" ");
for(k=1;k<i;k++)
printf("%d",k);
for(k=i;k>=1;k--)
printf("%d",k);
printf("\n");
}
getch();
}


Note:
      If you want to change in this program please write through the comment on this page. you can also past similar program 
                 of c++ with output.your comment is valuable to the other user and person.

comments (0)

avatar