What's New-Given Below
technicalsymposium
technicalsymposium
technicalsymposium

C/C++ Lab Program(s)/Materials

C PROGRAM FOR PASCAL TRIANGLE.

#include<stdio.h>
#include<conio.h>
void main()
{
int i=1,j,num,x=1;
clrscr();
printf("Please Enter the Number :");
scanf("%d",&num);
printf("\n\n");
printf("OUTPUT:\n");
printf("------");
printf("\n\n");
printf("The Pascal triangle is\n");
printf("**********************\n");
for(i=1;i<=num;i++)
{
for(j=1;j<=i;j++)
{
if(j==1)
{
x=1;
printf("%d",x);
}
else
{
x=(x*(i-j+1)/(j-1));
printf("%d",x);
}
}
printf("\n");
}
getch();
}

More Lab Programs with Answers -Given Below-Click and Get Freely

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com