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



1 1 1 1 2 1 ..

Answer / 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

More C Interview Questions

Why is c known as a mother language?

0 Answers  


What is the default value of local and global variables in c?

0 Answers  


How can I do serial ("comm") port I/O?

0 Answers   Celstream,


what is structuer?

4 Answers   LG Soft, Wipro,


what is pointer?

4 Answers  






Explain in detail how strset (string handling function works )pls explain it with an example.

1 Answers  


Should a function contain a return statement if it does not return a value?

0 Answers  


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

0 Answers   Wilco,


Hi, main() { } Is a user defined function or Built in Functionn

26 Answers   Honeywell, Yahoo,


develop algorithms to add polynomials (i) in one variable

0 Answers   Ignou, TCS,


What is meant by recursion?

0 Answers   ADP,


Difference between fopen() and open()?

3 Answers   Aricent,


Categories