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
Differentiate between #include<...> and #include '...'
What is 2 d array in c?
what is a function method?give example?
What are dangling pointers in c?
Here is a good puzzle: how do you write a program which produces its own source code as output?
Why does the call char scanf work?
How many identifiers are there in c?
how could explain about job profile
What are loops in c?
What is the use of structure padding in c?
What are the header files used in c language?
What the different types of arrays in c?
What does the file stdio.h contain?
What are the 5 types of inheritance in c ++?
Write a program to check palindrome number in c programming?