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

code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123

1 Answers   HCL,


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

0 Answers   Honeywell,


main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }

2 Answers  


main() { int i=10; i=!i>14; Printf ("i=%d",i); }

1 Answers  


Write a C program to print ‘Campus Force training’ without using even a single semicolon in the program.

3 Answers   Wipro,






#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }

1 Answers  


Write a single line c expression to delete a,b,c from aabbcc

2 Answers   Microsoft,


program to Reverse a linked list

12 Answers   Aricent, Microsoft, Ness Technologies,


main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }

1 Answers  


#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }

1 Answers  


main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }

1 Answers  


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

0 Answers  


Categories