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

Differentiate between calloc and malloc.

0 Answers   Wipro,


Every time i run a c-code in editor, getting some runtime error and editor is disposing, even after reinstalling the software what may be the problem?

2 Answers  


Write a program in C to convert date displayed in gregorian to julian date

0 Answers   HCL, Wipro,


write a program to find the number of even integers and odd integers in a given array in c language

13 Answers   IAI Cameroun, NIIT, Olive Tech, QIS,


1)which of following operator can't be overloaded. a)== b)++ c)?! d)<=

16 Answers   CybOrg, Siemens,






How to Clear last bit if it 1 using Macro TURN_OFF_BIT_LAST

6 Answers   Adobe, Huawei,


Is main() function predfined or userdefined?

11 Answers  


What is the output of below code? main() { static int a=5; printf("%3d",a--); if(a) main(); }

1 Answers  


write a program that will accept two integers and will implement division without using the division operator if the second value is an odd number and will implement multiplication without using multiplication operator if the second value is an even number.

1 Answers  


who is the founder of c

19 Answers   College School Exams Tests, HP,


What is structure pointer in c?

0 Answers  


What does 2n 4c mean?

0 Answers  


Categories