This is a Java program that calculates the area of a rectangle given its length and width.
import java.util.*; public class Area_Rectangle { public static void main(String []args) { double len,wid,area; Scanner input = new Scanner(System.in); System.out.print("Enter the Length : "); len = input.nextDouble(); System.out.print("Enter the width : "); wid = input.nextDouble(); area = len*wid; //Area = Length*width System.out.println("Area of Rectangle : " + area); } }
Enter the Length : 14 Enter the width : 17 Area of Rectangle : 238.0
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions