Translate

Sunday, 10 December 2017

java program area

import java.util.Scanner;

public class Parallelogram

{

    public static void main(String[] args) 

    {

        int a, b,area;

        Scanner s = new Scanner(System.in);

        System.out.print("Enter the base of parallelogram:");

        a = s.nextInt();

        System.out.print("Enter the height of the parallelogram:");

        b = s.nextInt();

        area = a * b;

        System.out.println("Area of parallelogram:"+area);

    }

}


Output:


Enter the base of parallelogram:5

Enter the height of the parallelogram:6

Area of parallelogram:30

No comments:

Post a Comment

Featured post

check box

<!DOCTYPE html> <html> <head>   <title>Check Box</title> </head> <body>   <input ty...