Write a program to input length and breadth of a rectangle and display area
Answers
Answered by
0
Answer:
In python
Explanation:
l = input( 'enter length')
b=input( 'enter breadth')
print('your rectangle area is ', l*b)
Answered by
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