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 |
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }
29 Answers IBM, TCS, UGC NET, Wipro,
How to swap two variables, without using third variable ?
104 Answers AB, ADP, BirlaSoft, Cisco, Cygnet Infotech, HCL, Hewitt, Honeywell, HP, IBM, Infosys, Manhattan, Microsoft, Mobius, Percept, Satyam, SofTMware, TCS, Wipro, Yamaha,
How do you write a program which produces its own source code as its output?
write a program for area of circumference of shapes
main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; } a. Runtime error. b. Compile error. Illegal syntax c. Gets into Infinite loop d. None of the above
Is the following code legal? typedef struct a { int x; aType *b; }aType
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", x--); } } a. 4, 3, 2, 1, 0 b. 1, 2, 3, 4, 5 c. 0, 1, 2, 3, 4 d. none of the above
void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }
main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }