1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Answers were Sorted based on User's Feedback
Answer / tknowledge05
#include<conio.h>
#include<stdio.h>
void main()
{
int a[10],b[10];
int c=1,n=4;
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 ? | 1 Yes | 0 No |
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 |
Answer / tknowledge05
The above guest is me .. okk....
by the time i solved and executing i was logged out and when i posted the answer it considered guest.......
Is This Answer Correct ? | 0 Yes | 0 No |
Write the control statements in C language
what is the function of pragma directive in c?
Explain a file operation in C with an example.
What are directives in c?
What is the output of the following progarm? #include<stdio.h> main( ) { int x,y=10; x=4; y=fact(x); printf(ā%d\nā,y); } unsigned int fact(int x) { return(x*fact(x-1)); } A. 24 B. 10 C. 4 D. none
What is period operator in c?
Differentiate between static and dynamic modeling.
When would you use a pointer to a function?
Explain what does the function toupper() do?
Discuss the function of conditional operator, size of operator and comma operator with examples.
Why main function is special give two reasons?
What is the process to create increment and decrement stamen in c?