Posted by: Sourav | May 14, 2015

Pascal’s Triangle in C


#include<stdio.h>
#include<conio.h>
#include<math.h>

void main()
{
int i,j;
long int m;
clrscr();
printf(“\t\n”);
for(i=0;i<=4;i++)
{
for(j=3;j>=i;j–)
{
printf(” “);
}
m=pow(11,i);
while(m>10)
{
printf(“%ld “,m%10);
m=m/10;

}
printf(“%ld “,m);
printf(“\n”);
}
getch();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: