PROG. TO PRODUCE 1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Answer / aadhirai r
#include<stdio.h>
#include<conio.h>
void main()
{
int j=2,n,num,b[20],a[20];
a[0]=1; a[1]=2; a[2]=1;
clrscr();
printf("Enter the no of rows");
scanf("%d",&num);
printf(" 1\n");
printf(" 1 1\n");
printf(" 1 2 1\n");
while(j<=num)
{
int i=0;
b[0]=1;
for(n=1;n<=j;n++)
{
b[n]=a[i]+a[i+1];
i++;
}
b[n]=1;
gotoxy(15-(j),j+3);
for(i=0;i<=n;i++)
{
printf("%d ",b[i]);
a[i]=b[i];
}
j++;
}
getch();
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }
29 Answers IBM, TCS, UGC NET, Wipro,
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
What is full form of PEPSI
String copy logic in one line.
What is "far" and "near" pointers in "c"...?
main() { static int var = 5; printf("%d ",var--); if(var) main(); }
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
Find your day from your DOB?
15 Answers Accenture, Microsoft,
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }