Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class number1 {
- public static void main(String[] args) {
- Scanner input = new Scanner (System.in);
- int length, breadth;
- System.out.println("Length: ");
- length = input.nextInt();
- System.out.println("Breadth: ");
- breadth = input.nextInt();
- //int area = area(5,6);
- System.out.printf("Area of rectangle: %d", area(length, breadth));
- }
- public static int area(int length, int breadth ) {
- int area;
- area = length * breadth;
- return area;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement