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

C statement to copy a string without using loop and library function..

2 Answers   Persistent, TCS,


void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above

2 Answers   HCL,


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

2 Answers  


WAP to display 1,2,3,4,5........N

2 Answers  


Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).

1 Answers  






#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer

1 Answers  


main() { extern out; printf("%d", out); } int out=100;

1 Answers  


why the range of an unsigned integer is double almost than the signed integer.

1 Answers  


#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

1 Answers  


#include<stdio.h> int main() { int x=2,y; y=++x*x++*++x; printf("%d",y); } Output for this program is 64. can you explain how this output is come??

1 Answers  


pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"

2 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  


Categories