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

#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?

2 Answers  


typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }

1 Answers  


main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4

18 Answers   HCL, IBM, Infosys, LG Soft, Satyam,


main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }

1 Answers  


main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above

3 Answers   HCL,






Printf can be implemented by using __________ list.

3 Answers  


hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?

6 Answers  


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

0 Answers  


write a program in c to merge two array

2 Answers  


what is brs test reply me email me kashifabbas514@gmail.com

0 Answers  


main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }

4 Answers   CSC,


4. Main() { Int i=3,j=2,c=0,m; m=i&&j||c&I; printf(“%d%d%d%d”,I,j,c,m); }

2 Answers   Broadridge,


Categories