ternary operators in java || Java programs || Java
In this, we are going to write a simple program to check Multiples using Ternary Operator in  Java.
 


class Multiple
{
    public static void main(String[] args) 
    {
        System.out.println((27 % 3 == 0) ? "Multiple of 3" : "Not a multiple of 3");
    }
}
#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post