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 |
#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300
When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?
In C program, at end of the program we will give as "return 0" and "return 1", what they indicate? Is it mandatory to specify them?
How does free() know how many bytes to free?
How can I set an array's size at run time?
What are pragmas and what are they good for?
how to find greatet of 10 numbers without using array?
what is available in C language but not in C++?
10 Answers CTS, TCS,
What are the two types of structure?
What is an arrays?
The __________ attribute is used to announce variables based on definitions of columns in a table?
Write a program to remove the C comments(/* */) and C++ comments(//) from a file. The file should be declared in command line.