Access over 20 million homework & study documents
search

pascal triangle C program

Content type

User Generated

Subject

Programming

Type

Lab

Rating

Showing Page:
1/1
PROGRAM:
#include<stdio.h>
void main()
{
int i,s,n,r,l,nf,rf,nrf;
printf("Enter the limit: ");
scanf("%d",&l);
for(n=0;n<l;n++)
{
nf=1;
for(i=l;i>n;i--)
{
printf(" ");
}
for(i=n;i>1;i--)
{
nf=nf*i;
}
for(r=0;r<=n;r++)
{
rf=1;
nrf=1;
for(i=r;i>1;i--)
{
rf=rf*i;
}
for(i=(n-r);i>1;i--)
{
nrf=nrf*i;
}
s=nf/(nrf*rf);
printf("%d ",s);
}
printf("\n");
}
}

Sign up to view the full document!

lock_open Sign Up

Unformatted Attachment Preview

PROGRAM: #include void main() { int i,s,n,r,l,nf,rf,nrf; printf("Enter the limit: "); scanf("%d",&l); for(n=0;nn;i--) { printf ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Just what I was looking for! Super helpful.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4