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 are the types of bitwise operator?
Why c is called object oriented language?
How do c compilers work?
What is a stream?
What is the advantage of using #define to declare a constant?
How can I split up a string into whitespace-separated fields?
What do you mean by Recursion Function?
what are the advantages of a macro over a function?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Is null a keyword in c?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
How does #define work?
What is const volatile variable in c?
What is the explanation for the dangling pointer in c?
how to introdu5ce my self in serco