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
Is register a keyword in c?
What does c mean?
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
How can I swap two values without using a temporary?
Function calling procedures? and their differences? Why should one go for Call by Reference?
Tell us something about keyword 'auto'.
What’s a signal? Explain what do I use signals for?
What is the use of #include in c?
Why is c called c not d or e?
What is exit() function?
explain what is fifo?
What are high level languages like C and FORTRAN also known as?
How can a program be made to print the line number where an error occurs?
Can you please explain the difference between exit() and _exit() function?
Why & is used in c?