3). In a math class you lean about the different operations that can be done to a series. Imagine the teacher have asked you to take 3 numbers. Arrange them in an increasing order. If the difference between the third number and the second number is less than the difference between second and first, display the square of each number in the series, or if the difference between the third number and the second number is greater than the difference between second and first, display the cube of each number in the series, else display the series. Write a C program to implement the above logic using suitable if statements and appropriate mathematical function. Sample Input and Output: Input 3 numbers::10 2 30 Sort 2 10 30 Cube Series:8 1000 27000 Input 3 numbers::12 1o Sort Series 11 10 11 12 is 10 11 12

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question
100%

c++ please

3). In a math class you lean about the different operations that can be done to a series. Imagine the
teacher have asked you to take 3 numbers. Arrange them in an increasing order. If the difference
between the third number and the second number is less than the difference between second and
first, display the square of each number in the series, or if the difference between the third number
and the second number is greater than the difference between second and first, display the cube of
each number in the series, else display the series. Write a C program to implement the above logic
using suitable if statements and appropriate mathematical function.
Sample Input and Output:
Input 3 numbers::10 2 30
Sort 2 10 30
Cube Series:8 1000 27000
Input 3 numbers::12 1o
Sort
Series
11
10
11
12
is
10
11
12
Transcribed Image Text:3). In a math class you lean about the different operations that can be done to a series. Imagine the teacher have asked you to take 3 numbers. Arrange them in an increasing order. If the difference between the third number and the second number is less than the difference between second and first, display the square of each number in the series, or if the difference between the third number and the second number is greater than the difference between second and first, display the cube of each number in the series, else display the series. Write a C program to implement the above logic using suitable if statements and appropriate mathematical function. Sample Input and Output: Input 3 numbers::10 2 30 Sort 2 10 30 Cube Series:8 1000 27000 Input 3 numbers::12 1o Sort Series 11 10 11 12 is 10 11 12
Expert Solution
steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Function Arguments
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