Java program arithmetic operators
PROGRAM: To show use of Arithmetic operators. /** * @Prof. Jayesh * Here use of arithmetic operators are shown. * Arithmetic operators … Read more
PROGRAM: To show use of Arithmetic operators. /** * @Prof. Jayesh * Here use of arithmetic operators are shown. * Arithmetic operators … Read more
PROGRAM: Simple program to show use of scanner class. import java.util.Scanner; public class AddScanner { public static void main(String args[]) { int x,y,z; System.out.println(“Enter 2 … Read more
PROGRAM: import java.util.Scanner; public class IfElse { public static void main(String args[]) { int marksObtained, passingMarks; passingMarks =40; Scanner input = new Scanner(System.in); System.out.println(“Input marks … Read more
PROGRAM: import java.util.Scanner; public class WhileLoop { public static void main(String args[]) { int n; Scanner input = new Scanner(System.in); … Read more
PROGRAM: public class ForLoop { public static void main(String args[]) { int c; for(c=1; c<=10; c++) { System.out.println(c); } } } OUTPUT: 1 2 … Read more
PROGRAM: import java.util.Scanner; public class IfElse { public static void main(String args[]) { int marksObtained, passingMarks; passingMarks =40; Scanner input = new Scanner(System.in); System.out.println(“Input marks … Read more
PROGRAM: import java.util.Scanner; public class AddNumbers { public static void main(String args[]) { int x,y,z; System.out.println(“Enter 2 integers to calculate sum”); Scanner in = new … Read more
PROGRAM: public class SwitchCase { public static void main(String args[]) { for(int i=0; i<=3; i++) { switch(i) { case 0: … Read more
PROGRAM: import java.util.Scanner; public class SwitchCaseWithScanner { public static void main(String args[]) { int i,j; System.out.println(“Enter any number”); Scanner s1 = … Read more
import java.util.Scanner; public class JavaProgram { public static void main(String args[]) { int noOfStudents, i,j,marks, sum=0, percent; System.out.println(“Please Enter number of … Read more