1. Use if - else - elif Write a program to get an integer input from the user. If the input is 25, get the length and breadth from the user and calculate the area of rectangle. [ Area of rectangle = length * breadth] If the input is 40, get the side from the user and calculate the area of square. [ Area of square = side * side] If the input is 65, get the radius from the user and calculate the area of circle. [ Area of circle = 3.14*r"r] Otherwise Display ' Enter number 25 or 40 or 65 .

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 32PE
icon
Related questions
icon
Concept explainers
Question
1. Use if - else - elif
Write a program to get an integer input from the user.
If the input is 25, get the length and breadth from the user and calculate the area of rectangle. [ Area of rectangle = length * breadth ]
If the input is 40, get the side from the user and calculate the area of square. [ Area of square = side * side]
If the input is 65, get the radius from the user and calculate the area of circle. [ Area of circle = 3.14"r*r]
Otherwise Display Enter number 25 or 40 or 65.
2. Use while loop to print the even numbers from 100 to 50. Print the product of all the even numbers.
Transcribed Image Text:1. Use if - else - elif Write a program to get an integer input from the user. If the input is 25, get the length and breadth from the user and calculate the area of rectangle. [ Area of rectangle = length * breadth ] If the input is 40, get the side from the user and calculate the area of square. [ Area of square = side * side] If the input is 65, get the radius from the user and calculate the area of circle. [ Area of circle = 3.14"r*r] Otherwise Display Enter number 25 or 40 or 65. 2. Use while loop to print the even numbers from 100 to 50. Print the product of all the even numbers.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning