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

Answers were Sorted based on User's Feedback



void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a...

Answer / guest

d) Lvalue required

Is This Answer Correct ?    16 Yes 4 No

void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a...

Answer / sandeep

answer



d> non of above
an error display at compile time L value required

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }

1 Answers  


How to return multiple values from a function?

7 Answers  


C program to print magic square of order n where n > 3 and n is odd

2 Answers   Accenture,


main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }

2 Answers   HP,


How to swap two variables, without using third variable ?

104 Answers   AB, ADP, BirlaSoft, Cisco, Cygnet Infotech, HCL, Hewitt, Honeywell, HP, IBM, Infosys, Manhattan, Microsoft, Mobius, Percept, Satyam, SofTMware, TCS, Wipro, Yamaha,






int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }

1 Answers  


What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }

1 Answers  


void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

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 int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } void foo() { #undef a #define a 50 }

3 Answers  


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


Categories