1
1 1
1 2 1
1 3 3 1
1 4 6 4 1

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


Please Help Members By Posting Answers For Below Questions

What are the types of bitwise operator?

805


Why c is called object oriented language?

778


How do c compilers work?

772


What is a stream?

850


What is the advantage of using #define to declare a constant?

813






How can I split up a string into whitespace-separated fields?

770


What do you mean by Recursion Function?

823


what are the advantages of a macro over a function?

831


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

933


Is null a keyword in c?

907


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1152


How does #define work?

824


What is const volatile variable in c?

753


What is the explanation for the dangling pointer in c?

862


how to introdu5ce my self in serco

1711