main()

{

int x=5;

clrscr();

for(;x==0;x--) {

printf("x=%d\n”", x--);

}

}

a. 4, 3, 2, 1, 0

b. 1, 2, 3, 4, 5

c. 0, 1, 2, 3, 4

d. none of the above

Answers were Sorted based on User's Feedback



main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", ..

Answer / guest

d) prints nothing, as condition x==0 is False

Is This Answer Correct ?    11 Yes 0 No

main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", ..

Answer / ana

nothing

Is This Answer Correct ?    4 Yes 0 No

main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", ..

Answer / ranjith v

d:None of the above
Explanation:
In for loop the condition x==0,i.e;x0 is assigned to
zero.which means x value will be 0 not the 5.so it causes error.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }

1 Answers  


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above

1 Answers   emc2, HCL,


void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }

1 Answers  






main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above

3 Answers   BrickRed, HCL,


void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }

1 Answers  


main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }

1 Answers  


plz send me all data structure related programs

2 Answers  


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

4 Answers   HCL, LG,


Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

1 Answers  


main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

2 Answers   Adobe, CSC,


Categories