1
1 1
1 2 1
1 3 3 1
1 4 6 4 1

Answer Posted / guest

#include<conio.h>
#include<stdio.h>
void main()
{
int a[10],b[10];
int c=1,n=5;
a[0]=0;a[1]=1;a[2]=0;
b[0]=0;
printf("Enter no. of rows to print ");
scanf("%d",&n);
for(int i=0;i<n;i++)
{
for(int j=n-2;j<0;j++)
printf(" ");
c++;
for(int k=0;k<c;k++)
{
b[k+1]=a[k]+a[k+1];
}
b[c]=0;
for(int k=1;k<=i+1;k++)
{
printf("%d ",a[k]);
}
printf("\n");
for(int k=0;k<i+3;k++)
a[k]=b[k];
}
getch();
}


Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is register a keyword in c?

641


What does c mean?

594


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

626


How can I swap two values without using a temporary?

621


Function calling procedures? and their differences? Why should one go for Call by Reference?

639






Tell us something about keyword 'auto'.

668


What’s a signal? Explain what do I use signals for?

615


What is the use of #include in c?

585


Why is c called c not d or e?

617


What is exit() function?

566


explain what is fifo?

639


What are high level languages like C and FORTRAN also known as?

691


How can a program be made to print the line number where an error occurs?

657


Can you please explain the difference between exit() and _exit() function?

600


Why & is used in c?

722