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



main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; ..

Answer / guest

b) illegal syntax for using return

Is This Answer Correct ?    17 Yes 5 No

main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; ..

Answer / akshata

d. None of the above

Is This Answer Correct ?    3 Yes 4 No

main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; ..

Answer / viliami

The answer is 0

Is This Answer Correct ?    2 Yes 4 No

main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; ..

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

Post New Answer

More C Code Interview Questions

Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

2 Answers  


All the combinations of prime numbers whose sum gives 32

1 Answers   HHH,


char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)

1 Answers  


char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }

2 Answers  


main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

1 Answers   CSC,






how to swap 3 nos without using temporary variable

4 Answers   Satyam,


void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }

3 Answers   Accenture,


Write a program to receive an integer and find its octal equivalent?

7 Answers  


int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }

3 Answers   Cisco, HCL,


Implement a t9 mobile dictionary. (Give code with explanation )

1 Answers   Amazon, Peak6, Yahoo,


respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"

1 Answers   Genpact, Ozdocs,


main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }

2 Answers   IBM,


Categories