(i) Rewrite the following code using single if statement.
if (code='g")
System.out.println ("GREEN ");
else if (code=="G ")
System.out.println ("GREEN ");


Solution



if (code =='g' || code =='G' )
System.out.printin(“GREEN");



Reach Us

SERVICES

  • ACADEMIC
  • ON-LINE PREPARATION
  • FOUNDATION & CRASH COURSES

CONTACT

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+918081967119