1. Use if - else - elif Read 3 numbers from the user and check the following. () If the 1st number is more then 2nd number, add both the numbers. (1i) If the 2nd number is less than 3rd number, find the product of both the numbers and print the (iii) If the 15t number is more than 3rd number, print the square of both the numbers.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 9PP
icon
Related questions
icon
Concept explainers
Question
1. Use if - else - elif
Read 3 numbers from the user and check the following.
() If the 1st number is more then 2nd number, add both the numbers.
(1i) If the 2nd number is less than 3rd number, find the product of both the numbers and print the product.
(iii) If the 15t number is more than 3rd number, print the square of both the numbers.
2. Use loops to calculate the following series.
1210/xY + 1311/ x + 1412/x +...n-2 /x using any 1 loop of your choice.
Transcribed Image Text:1. Use if - else - elif Read 3 numbers from the user and check the following. () If the 1st number is more then 2nd number, add both the numbers. (1i) If the 2nd number is less than 3rd number, find the product of both the numbers and print the product. (iii) If the 15t number is more than 3rd number, print the square of both the numbers. 2. Use loops to calculate the following series. 1210/xY + 1311/ x + 1412/x +...n-2 /x using any 1 loop of your choice.
Expert Solution
steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Control Structure
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning