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 |
how to find anagram without using string functions using only loops in c programming
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
what is an array
how to print 2-D array using a single for loop?
2 Answers Mind Tree, TCS, Value Labs,
with out using main how to execute the program?
Not all reserved words are written in lowercase. TRUE or FALSE?
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
How do we swap or interchange any 2 numbers without using Temporary variable...Anybody can pls answer it.. Thanks in Advance
What is the use of volatile?
what is Array?
Which is better oop or procedural?
why array index always starts from zero??