Java program to print Ascii Table

 Java program to print Ascii Table 1. Java program to print Ascii Table using for loop: Program: import java.io.*; import java.lang.*; class AsciiTable { public static void main(String args[]) { for(int i=0; i<=255;i++) { char ch=(char)i; System.out.println(i+”\t”+ch); } } } Output: . . . . . 48 0 49 1 50 2 . . . … Read more

Java program to check the number is equal to 2000 or not

 Java program to check the number is equal to 2000 or not 1. Java program to check the number is equal to 2000 or not using if- else statement: Program: import java.io.*; import java.util.*; class EqualsTo { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println(“Enter the number”); int num= sc.nextInt(); if(num==2000) … Read more

Even number from 7 to 700

import java.io.*; class EvenOdd { public static void main(String args[]) { long num; for(num=7;num<=700;num++) { if(num%2==0) { System.out.println(“Even no”+num); } } } }  

Java Program to check Greatest or Equal of Two numbers

 Java Program to check Greatest or Equal of Two numbers  1. Java Program to check Greatest or Equal of Two numbers using if-else if statement: Program: import java.io.*; import java.util.*; class GreatestOfTwo { public static void main(String args[]) { int num1,num2; Scanner sc=new Scanner(System.in); System.out.println(“Enter the value of number1”); num1=sc.nextInt(); System.out.println(“Enter the value of number2”); … Read more

Java Program to print Greatest of two numbers

Java Program to print Greatest of two numbers 1. Java Program to print Greatest of two numbers using if Statement: Program: import java.io.*; import java.util.*; class GreatestOfTwo { public static void main(String args[]) { int num1=20, num2=55, max ; max=num2; if(num1>num2) { max=num1; } System.out.println(“The Greatest of two numbers is “+max); } } Output: The Greatest … Read more

Java Program to calculate Average of three numbers- 6 ways

Java Program to calculate Average of three numbers- 6 ways The java program to calculate average of three numbers has been written in five different ways such as Scanner class, direct value initialization, Buffered Reader class, Command Line argument, methods, and using Constructor. Java Program to calculate Average of three numbers- 6 ways are given below: … Read more

Java Program to Calculate Area of Triangle – 5 different ways

 Java Program to Calculate Area of Triangle – 5 different ways The java program to calculate area of triangle has been written in five different ways such as Scanner class, direct value initialization, Buffered Reader class, Command Line argument, and using Constructor. Java Program to Calculate Area of Triangle – 5 different ways are as … Read more

Java Program to calculate area of circle – 5 different ways

Java Program to calculate area of circle – 5 different ways The java program to calculate area of circle has been written in five different ways such as Scanner class, direct value initialization, Buffered Reader class, Command Line argument, and using Constructor. Java Program to calculate area of circle – 5 different ways are as follows: … Read more

Java Program to perform multiplication of two numbers – 5 ways

Java Program to perform multiplication of two numbers – 5 ways Java supports different types of Operators. Operators can be classified into numbers of categories: Arithmetic operators, Bitwise operators, Logical Operators, Conditional operators, Assignment Operators, Relational operators, Special operators, Increment Operators, Decrement operators. Java Program to perform multiplication of two numbers – 5 ways are given … Read more

Java Program to perform addition and Substraction of 2 numbers – 5 ways

Arithmetic Operator: An Operator is a symbol that tells the computer to perform various operation like Mathematical or Logical Operations. Arithmetic operators are used to Construct mathematical expressions. Java Provides different types of Arithmetic operators. They are Addition, Substraction, Multiplication, and Division.    The Process of programming in java is divided into 3 phases: 1. … Read more