You are on page 1of 1

class Main {

public static void main(String[] args) {


System.out.println("Hello world!");
}
}

import java.util.Scanner; // Needed for Scanner class


class Main {
public static void main(String[] args) {
int length;
int width;
int area;
Scanner console = new Scanner(System.in);
System.out.print("Enter length");
length = console.nextInt();
System.out.print("Enter width");
width = console.nextInt();
area=length*width;
System.out.println("Area of rectangle is" + area);

}
}

You might also like