Computer Science, asked by panjabobby86, 9 months ago

Hey Mate, I am having a doubt in solving this one. This question is from Conditional Constructs in Java chapter.If you know how to solve this one then plzz help me.
Thank you ​

Attachments:

Answers

Answered by Anonymous
1

Hey Buddy

Here's The Answer

-------------------------------------------

This snippet has error in first statement, i.e

if ( x = 1 )

It's a wrong statement, if is a decision making operation,

x = 1 , mean x has a value which is 1

x == 1, it is a check operation which mean, is x have value 1 ? , if yes then it will execute according to the code

So, correction will be

if ( x == 1 )

k = 100 ;

else

Hope It Helps

Similar questions