1
1 1
1 2 1
1 3 3 1
1 4 6 4 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 |
Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fifteen terms.
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal)
How main function is called in c?
Explain #pragma statements.
Is using exit() the same as using return?
Do pointers store the address of value or the actual value of a variable?
how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n");
Hi Every one......... Please Any body give me the answer for my question. Is it possible to print the word "PRINT F", without using printf() statement in C-Language.
List the variables are used for writing doubly linked list program.
i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k);
Explain in detail how strset (string handling function works )pls explain it with an example.