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
Answers were Sorted based on User's Feedback
Answer / sushil
it will give a run time error since , return cannot be used
as it is used in ternary operator.
| Is This Answer Correct ? | 1 Yes | 3 No |
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
Write a routine to implement the polymarker function
main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
main() { char a[4]="HELL"; printf("%s",a); }
Cau u say the output....?
#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(); }
Give a one-line C expression to test whether a number is a power of 2.
main() { int x=5; for(;x!=0;x--) { printf("x=%d\n", x--); } } a. 5, 4, 3, 2,1 b. 4, 3, 2, 1, 0 c. 5, 3, 1 d. none of the above
What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }
How do you sort a Linked List (singly connected) in O(n) please mail to pawan.10k@gmail.com if u can find an anser...i m desperate to knw...
6 Answers Microsoft, MSD, Oracle,
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }