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

writ a program to compare using strcmp VIVA and viva with its output.

1525


What is return type in c?

639


Why is C language being considered a middle level language?

654


How can my program discover the complete pathname to the executable from which it was invoked?

660


Why is c known as a mother language?

749






how do you programme Carrier Sense Multiple Access

1516


How can you be sure that a program follows the ANSI C standard?

1127


What is getch() function?

649


What is a macro?

657


Do you know the use of fflush() function?

603


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

658


What is the difference between strcpy() and memcpy() function in c programming?

626


Explain how are 16- and 32-bit numbers stored?

783


How do you declare a variable that will hold string values?

670


Why is c called a structured programming language?

677