tg-me.com/java_codings/9
Last Update:
5. Program to Accept value of length & width and Calculate Area of Rectangle.
import java.util.Scanner;
class AreaOfRectangle
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the length of Rectangle:");
double length = scanner.nextDouble();
System.out.println("Enter the width of Rectangle:");
double width = scanner.nextDouble();
//Area = length*width;
double area = length * width;
System.out.println("Area of Rectangle is:" + area);
}
}
@java_codings
BY Advance Java π¨βπ»
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/java_codings/9