1 Following Options Checks City Neither Chicago Dallas City Chicago City Dallas City Chica Q37208144

1.Which of the following options checks that city is neitherChicago nor Dallas?

if (city != “Chicago” || city != “Dallas”)

if !(city == “Chicago” || city == “Dallas”)

if !(city == “Chicago” && city == “Dallas”)

if (city != “Chicago” || city == “Dallas”)

2.What is the value of the cost variable after the followingcode snippet is executed?

int cost = 82;if (cost < 100) { cost = cost + 10; }if (cost > 50) { cost = cost * 2; }if (cost < 100) { cost = cost – 20; }

82

92

184

164

3.What is the value of the

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.