Answer Posted / tknowledge05
#include<conio.h>
#include<stdio.h>
void main()
{
int a[10],b[10];
int c=1,n=4;
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 ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why do we need a structure?
while initialization of array why we use a[][2] why not a[2][]...?
What is an expression?
What is volatile variable in c with example?
Why main is used in c?
Describe the difference between = and == symbols in c programming?
Tell me when would you use a pointer to a function?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
in iso what are the common technological language?
Explain low-order bytes.
How can I recover the file name given an open stream?
How can I sort more data than will fit in memory?
Explain union.
Explain what is wrong with this program statement?