A
A
Andrey Lyubimenko2018-10-16 21:01:16
C++ / C#
Andrey Lyubimenko, 2018-10-16 21:01:16

Why is the number not reversed?

Please tell me why the second part of the task is not executed? what am i doing wrong?
Task: Given three variables of real type A B C. If their values ​​are sorted in ascending or descending order, then double them. Otherwise, replace the value of each variable with the opposite, display the resulting values.
Here is what I have5bc6276727491517664747.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2018-10-16
@andrewlybimenko

change the value of each variable to the opposite

It's simple A = -A;, no conditions needed.
This A *= 2;is what you have written - this is squaring.

V
vreitech, 2018-10-16
@fzfx

what is the "second part"?
and you also clearly have an error in line 13 - four brackets are missing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question