main()
{
intx=2,y=6,z=6;
x=y=z;
printf(%d",x)
}

Answers were Sorted based on User's Feedback



main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }..

Answer / sorab

error becoz in program written as printf(%d",x)
actually it written like that printf("%d",x);
then the value 6 is print on screen

thanks ....

Is This Answer Correct ?    36 Yes 7 No

main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }..

Answer / krs

"intx=2" must be "int x=2".This is First error.
secondly there is a syntax error in printf();
So there is compile time error due to this code execution.

Is This Answer Correct ?    14 Yes 1 No

main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }..

Answer / dhananjay

x=6 beacuse x will contain the latest value.

Is This Answer Correct ?    21 Yes 14 No

main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }..

Answer / nithya

output:

undefined symbol 'intx'
undefined symbol 'y'
undefined symbol 'z'
syntax error 'printf(%d",x)'

the above code will be change

main()
{
int x=2,y=6,z=6;
x=y=z;
printf("%d",x);
}

output:

warning error:y assign value not used

6

Is This Answer Correct ?    5 Yes 0 No

main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }..

Answer / kdedman.kan

x=6 , because its the latest value.

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More C Interview Questions

What is struct node in c?

0 Answers  


Write an implementation of “float stringToFloat(char *str).” The code should be simple, and not require more than the basic operators (if, for, math operators, etc.). • Assumptions • Don’t worry about overflow or underflow • Stop at the 1st invalid character and return the number you have converted till then, if the 1st character is invalid return 0 • Don’t worry about exponential (e.g. 1e10), instead you should treat ‘e’ as an invalid character • Write it like real code, e.g. do error checking • Go though the string only once • Examples • “1.23” should return 1.23 • “1a” should return 1 • “a”should return 0

6 Answers   Qualcomm,


State the difference between realloc and free.

0 Answers   Aricent,


Write a program to check whether a number is prime or not using c?

0 Answers  


How pointer is different from array?

0 Answers  






What is c value paradox explain?

0 Answers  


What are the two types of structure?

0 Answers  


the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters

2 Answers  


What does calloc stand for?

0 Answers  


What is the Difference between Class and Struct?

10 Answers   Motorola,


What is variable in c example?

0 Answers  


union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",ch[10]); }

3 Answers  


Categories