mercredi 24 juin 2020

this if-else question shows output to be 48

public class ControlStatement {
 
    public static void main(String[] args) {
       int a=25;

       if (a-->a--) {
          {
            a='0';
          }
       }
       else {
          --a;
       }

       System.out.print(a);
   }
}

This outputs 48. how did the answer come as 48? can anyone please explain

Aucun commentaire:

Enregistrer un commentaire