calculate area of rectangle
calculate area of rectangle
Problem Description
Write a program for object and class in java.
Logic Test Case 1
Input (stdin)
5
10
Expected Output
Area=50
Logic Test Case 2
Input (stdin)
2
10
Expected Output
Area=20
CODE AREA
import java.io.*;
import java.util.*;
public class TestClass {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int a=s.nextInt();
int b=s.nextInt();
System.out.println("Area="+(a*b));
}
}
0 Comments