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
What does c mean in basketball?
What is the purpose of ftell?
What does %p mean c?
Difference between Function to pointer and pointer to function
How to throw some light on the b tree?
What is 2 d array in c?
What is the purpose of macro in C language?
What are the three constants used in c?
what will be maximum number of comparisons when number of elements are given?
What is the maximum length of an identifier?
What is c++ used for today?
How can I open a file so that other programs can update it at the same time?
What is c language used for?
Can we change the value of constant variable in c?
What does 3 periods mean in texting?