Computer Science, asked by sahirasrii40701, 6 months ago

Write a program to input length and breadth of a rectangle and display area

Answers

Answered by parthu2011
0

Answer:

In python

Explanation:

l = input( 'enter length')

b=input( 'enter breadth')

print('your rectangle area is ', l*b)

Answered by Oreki
1

Python:

length, breadth = float(input("Enter length - ")), float(input("Enter breadth - "))

area = length * breadth

print(f"Area - {area} cm square")

Java:

import java.util.Scanner;

public class Area {

   public static void main(String[ ] args) {

       Scanner sc = new Scanner(System.in);

       System.out.print("Enter length - ");

       float length = sc.nextFloat( );

       System.out.print("Enter breadth - ");

       float breadth = sc.nextFloat( ),

               area = length * breadth;

       System.out.println("Area - " + area + " cm square");

   }

}

Similar questions