Omoops 1
Omoops 1
Program on Various ways to accept data through keyboard and unsigned right shift operator
Input through Command Line Argument
To demonstrate the concept of arithmetic operators.
List the subjects offered to you in sem III
Input through scanner Class
Print the Fibonacci series upto the nth term taking the value of n from the user.
WAP to reverse the four digit no.
Unsigned right shift operator
Demonstrate the working of right shift operator.
OBJECTIVE : To make students understand how to take input from the user and explain the difference
in working of right shift operator and unsigned right shift operator.
DESCRIPTION : Students should write about the following along with examples to support the theory
Command-Line Arguments
Scanner class
Bitwise operators in java and C
CONCLUSION: Students are expected to List the error they are facing along with their solution
REFERENCES :
Practical no:1 public class Main {
public static void main(String[] args) {
float x = 6; float y = 3; float z = 2;
System.out.println("Addition:"+(x + y+z));
System.out.println("Subtraction:"+(x-y-z));
System.out.println("Multiplication:"+x*y*z);
System.out.println("Division:"+x/y/z);
System.out.println("Modulous:"+x%y);
System.out.println("Increament:"+(++x));
System.out.println("Decreament:"+(--y));
}
}
Output:
Addition:11.0
Subtraction:1.0
Multiplication:36.0
Division:1.0
Modulous:0.0
Increament:7.0
Decreament:2.0
Output:
Math-3
Dsgt
DLCA
DS
CG
OOPM
java.util.Scanner;
System.out.println(“Om Gaikwad”);
Scanner scanner = new Scanner(System.in);
t2 = sum;
System.out.println();
Output:
main(String[] args) {
System.out.println(“Om Gaikwad”);
Output:
import java.util.Scanner;
System.out.println(“Om Gaikwad”);
num = scanner.nextInt();
System.out.println("Unsigned right shift of " + num + " by 1 bit: " + (num >>> 1));
System.out.println("Unsigned right shift of " + num + " by 2 bits: " + (num >>> 2));
System.out.println("Unsigned right shift of " + num + " by 3 bits: " + (num >>> 3)); }
Output: