Upload files to "OOP/Java/Lab/Week2"
This commit is contained in:
parent
40f695b27c
commit
24683dac5a
3 changed files with 85 additions and 0 deletions
21
OOP/Java/Lab/Week2/BitwiseMulDiv.java
Normal file
21
OOP/Java/Lab/Week2/BitwiseMulDiv.java
Normal 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+".");
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue