From 8f39db0fbf2d6f8022d71b9b849893230d42abaa Mon Sep 17 00:00:00 2001 From: sonalprabhu <35455325+sonalprabhu@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:10:54 +0530 Subject: [PATCH] Create Multiple_of_eight.java --- .../Multiple-of-8/Multiple_of_eight.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Bit Manipulation/Multiple-of-8/Multiple_of_eight.java diff --git a/Bit Manipulation/Multiple-of-8/Multiple_of_eight.java b/Bit Manipulation/Multiple-of-8/Multiple_of_eight.java new file mode 100644 index 000000000..73ed97d74 --- /dev/null +++ b/Bit Manipulation/Multiple-of-8/Multiple_of_eight.java @@ -0,0 +1,16 @@ +import java.util.*; + +class Multiple_of_eight +{ + public static void main (String[] args) throws java.lang.Exception + { + Scanner sc=new Scanner(System.in); + int n=sc.nextInt(); + int result=n; + result=(result>>3)<<3; + if(result==n) + System.out.println("Multiple of 8"); + else + System.out.println("Not a Multiple of 8"); + } +}