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
writ a program to compare using strcmp VIVA and viva with its output.
What is return type in c?
Why is C language being considered a middle level language?
How can my program discover the complete pathname to the executable from which it was invoked?
Why is c known as a mother language?
how do you programme Carrier Sense Multiple Access
How can you be sure that a program follows the ANSI C standard?
What is getch() function?
What is a macro?
Do you know the use of fflush() function?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
What is the difference between strcpy() and memcpy() function in c programming?
Explain how are 16- and 32-bit numbers stored?
How do you declare a variable that will hold string values?
Why is c called a structured programming language?