Program 8:- Write a program to read the length and breadth of a rectangle from a user and display the area of the rectangle.
Answers
print ( ' Enter Length of Rectangle : ' , end= ' ' )
Length = int ( input ( ) )
print ( ' Enter Breadth of Rectangle: ' , end= ' ' )
Breadth = int ( input ( ) )
Area = Length * Breadth
print ( ' - - - - - Details of Rectangle - - - - - ' )
print ( ' Length = ' , Length )
print ( ' Breadth = ' , Breadth )
print ( ' Area of rectangle is : ' , Area )
*Output*
Enter Length of Rectangle: 10
Enter Breadth of Rectangle: 20
- - - - - Details of Rectangle - - - - -
Length = 10
Breadth = 20
Area of rectangle is: 200
.
.
*● NOTE:-* A program can make use of any type to convert the string into a specific type.
*Example:-* X = int ( input ( ) )
*#* Convert it to int
X = float ( input ( ) )
*#* Convert it to float
Explanation:
l= int(input ("enter value"))
b=int(input ("enter value"))
area= l*b
print("area is" ,area)