Java Program To Find Area And Perimeter Of Square

import java.lang.*; class Square { public static void main(String args[]) { float s=2.3f,area,peri; System.out.println(“\nSquare:\n”); System.out.println(“Side of the square : “+s); area=(s*s); peri=(4*s); System.out.println(“Area of the square : “+area); System.out.println(“Perimeter of the square : “+peri); } } 46,790 total views, 28 views today

46,790 total views, 28 views today

Read More

Java Program To Find Area And Perimeter Of Rectangle

import java.lang.*; class Rectangle { public static void main(String args[]) { float a=5.3f,b=6.3f,area,peri; System.out.println(“\nRectangle:\n”); System.out.println(“Sides of the Rectangle a : “+a+” b : “+b); area=(a*b); peri=(2*(a+b)); System.out.println(“Area of the Rectangle : “+area); System.out.println(“Perimeter of the Rectangle : “+peri); } } 39,627 total views, 278 views today

39,627 total views, 278 views today

Read More

Java Program To Demonstrate Logical Operators

import java.lang.*; class Logical_Operators { public static void main(String args[]) { System.out.println(“\nLogical AND : \n”); System.out.println(“True && True : “+(true&&true)); System.out.println(“True && False : “+(true&&false)); System.out.println(“False && True : “+(false&&true)); System.out.println(“False && False : “+(false&&false)); System.out.println(“\nLogical OR : \n”); System.out.println(“True || True : “+(true||true)); System.out.println(“True || False : “+(true||false)); System.out.println(“False || True : “+(false||true)); System.out.println(“False…

23,799 total views, 160 views today

Read More

Java Program To Demonstrate Increment And Decrement Operators

import java.lang.*; class Inc_dec_operators { public static void main(String args[]) { int a=10; System.out.println(“\nIncrement Operators:\n”); System.out.println(“\nPre Increment Operator:\n”); System.out.println(“a : “+a); System.out.println(“++a : “+(++a)); System.out.println(“a : “+a); System.out.println(“\nPost Increment Operator:\n”); System.out.println(“a : “+a); System.out.println(“a++ : “+(a++)); System.out.println(“a : “+a); System.out.println(“\nDecrement Operators:\n”); System.out.println(“\nPre Decrement Operator:\n”); System.out.println(“a : “+a); System.out.println(“–a : “+(–a)); System.out.println(“a : “+a); System.out.println(“\nPost Decrement…

41,312 total views, 350 views today

Read More

Java Program To Accept Employee Details And Display It

import java.io.*; class Employee_Details { public static void main(String args[]) throws IOException { int eno,eage; String ename; float esal; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println(“Enter The Employee Number: “); eno=Integer.parseInt(br.readLine()); System.out.println(“Enter The Employee Name: “); ename=br.readLine(); System.out.println(“Enter The Employee Age: “); eage=Integer.parseInt(br.readLine()); System.out.println(“Enter The Employee Salary: “); esal=Float.parseFloat(br.readLine()); System.out.println(“Employee Number: “+eno); System.out.println(“Employee Name: “+ename); System.out.println(“Employee Age:…

52,466 total views, 122 views today

Read More

Java Program To Find Area And Circumference Of Circle

import java.lang.*; class Circle { public static void main(String args[]) { float r=1.5f,pi=3.14f; System.out.println(“\nCircle:\n”); System.out.println(“Radius Of The Circle : “+r); System.out.println(“Area Of The Circle : “+(pi*r*r)); System.out.println(“Circumference Of The Circle : “+(2*pi*r)); } } 24,058 total views, 70 views today

24,058 total views, 70 views today

Read More