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
Write a program to generate the Fibinocci Series
Place the #include statement must be written in the program?
What are the types of assignment statements?
How would you obtain the current time and difference between two times?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
What is structure padding and packing in c?
What is meant by 'bit masking'?
How arrays can be passed to a user defined function
How can I list all of the predefined identifiers?
What is the general form of a C program?
How to Throw some light on the splay trees?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is struct node in c?
When the macros gets expanded?
Can the sizeof operator be used to tell the size of an array passed to a function?