Upload files to "OOP/Java/Lab/Week2"

This commit is contained in:
aadit 2024-08-05 01:05:13 +05:30
parent 40f695b27c
commit 24683dac5a
3 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import java.util.Scanner;
public class BitwiseMulDiv {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a,b,c;
System.out.println("Enter the value you want as an input: ");
a = sc.nextInt();
b = a >> 1;
System.out.println("When divided by 2, the result is "+b+".");
c = a << 1;
System.out.println("When divided by 2, the result is "+c+".");
}
}