Professional Documents
Culture Documents
import java.util.Scanner;
class Basic{
public static void main(String args[]) {
Scanner hel = new Scanner(System.in);
System.out.println(hel.nextLine());
}
}
import java.util.Scanner;
class Basic{
public static void main(String args[]) {
Scanner text = new Scanner(System.in);
String Small = text.nextLine();
System.out.println(Small);
}
}
import java.util.Scanner;
class Basic{
public static void main(String args[])
{
Scanner number = new Scanner(System.in);
Double Small = number.nextDouble();
System.out.println(Small);
}
}
import java.util.Scanner;
class Basic{
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
double x,y,z;
z = x+y;
class Basic{
public static void main(String args[]) {
int x,y;
x=11;
y=1;
x += 5;
System.out.println(x);
}
}
class Basic{
public static void main(String args[]) {
int apples,grapes;
apples = 10;
grapes = 18;
if(apples == grapes) {
System.out.println("yes they are equal!!");
}
else {
System.out.println("they are not equal");
}
}
}
//Calculator using if condition
import java.util.Scanner;
class Basic{
public static void main(String args[]) {
double x,y,z,a,b;
x = 20;
y = 18;
z = x+y;
a = x-y;
if(b == 1) {
System.out.println(z);
}
else {
if(b == 2)
System.out.println(a);
}
}
}
z = x+y;
a = x-y;
else if(b == 2)
{
System.out.println("your result is: "+a);
}
else {
System.out.println("Enter the correct accoring to first statement
braces!!!!");
}
}
}
}
}
switch(g) {
case 1:
System.out.println(c);
break;
case 2:
System.out.println(d);
break;
case 3:
System.out.println(e);
break;
case 4:
System.out.println(f);
break;
default:
System.out.println("enter the correct operator!!!");
}
}
}
import java.util.Scanner;
class Basic{
public static void main(String args[]) {
int a;
Scanner input = new Scanner(System.in);
System.out.print("a=");
a = input.nextInt();
if(a == 14 || a == 15 || a == 16 || a == 17 ) {
System.out.println("eligible!!");
}
else {
System.out.println("not eligible!!");
}
}
}