Is the following code legal?
typedef struct a aType;
struct a
{
int x;
aType *b;
};
Answer / susie
Answer :
Yes
Explanation:
The typename aType is known at the point of declaring the
structure, because it is already typedefined.
Is This Answer Correct ? | 4 Yes | 0 No |
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p
How can you relate the function with the structure? Explain with an appropriate example.
#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }
#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above
main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }
#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }
void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }
void main() { int i=5; printf("%d",i+++++i); }
How to access command-line arguments?
What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }