| 1 | import java.util.Scanner; |
| 2 | public class EvenOdd { |
| 3 | public static void main(String[]args){ |
| 4 | Scanner sc = new Scanner(System.in); |
| 5 | System.out.println("enter the number"); |
| 6 | int num = sc.nextInt(); |
| 7 | // using bitwise and operation |
| 8 | /* when we convert any decimal number to binary the least significant bit or the last bit if it is 0 -> then it is |
| 9 | a even number and if the last bit is 1 it is a odd number. */ |
| 10 | if((num&1) == 0){ |
| 11 | System.out.println("even number"); |
| 12 | }else{ |
| 13 | System.out.println("odd number"); |
| 14 | } |
| 15 | } |
| 16 | } |
nothing calls this directly
no outgoing calls
no test coverage detected