Skip to content
Programs · Program 5-3

Q.Program 5-3: Write a Python program to find the area of a rectangle given that its length is 10 units and breadth is 20 units.

Uttarakhand UbseTextbookSubjective· 2mImportance★★★★★est
12% · 6/49 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Assign the given length and breadth to variables, compute length * breadth, and print the result — 10 × 20 = 200 square units.

The idea. This is the simplest input–process–output pattern: the data is fixed by the question (length = 10, breadth = 20), the process is the well-known formula area = length × breadth, and the output is one print(). Using variables (instead of writing print(10*20)) makes the program self-documenting and easy to change later.

Program

# prog5-3.py
# Program to find the area of a rectangle
length = 10
breadth = 20
area = length * breadth
print("Area of the rectangle is", area, "square units")

Expected output

Area of the rectangle is 200 square units

Key lines

  • length = 10 and breadth = 20 store the given dimensions as integers.
  • area = length * breadth evaluates 10 × 20 = 200 and stores it in area. Since both operands are int, the result is the int 200. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.