The following code segment should print “You can go out” if you have done your homework (dh) and cleaned your room(cr). However, the code has errors. Fix the code so that it compiles and runs correctly.

boolean dh = True;
boolean cr= true;
if (dh && cr)
System.out.println("You cannot go out");
else
System.out.println("You can go out");


Solution



boolean dh = true;
boolean cr= true;
if (dh && cr)
System.out.println("You can go out");
else
System.out.println("You cannot go out");


Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com