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 does the characters “r” and “w” mean when writing programs that will make use of files?

0 Answers  


Hai friends im a i year student. i want to develop my knowledge in the field of TSR in c. How I'm Improve ?

2 Answers  


to write a program, that finds the minimum total number of shelves, including the initial one, required for this loading process. The packets are named A, B, C, D, E …….. Any numbers of packets with these names could be kept in the shelf, as in this example: [ZZLLAAJKRDFDDUUGGYFYYKK]. All packets are to be loaded on cars. The cars are lined in order, so that the packets could be loaded on them. The cars are also named [A, B, C, D, E,………….].

2 Answers   Infosys, TCS,


What is a char c?

0 Answers  


Why we use void main in c?

0 Answers  






Is null always defined as 0(zero)?

0 Answers  


What is data structure in c language?

0 Answers  


How do you do dynamic memory allocation in C applications?

0 Answers  


Why c is called a middle level language?

0 Answers  


Why isnt any of this standardized in c?

0 Answers  


What is Dynamic Initialization.

3 Answers  


What is the difference between volatile and const volatile?

0 Answers  


Categories