Answer to Question #297331 in C++ for Esh

Question #297331

Draw a flow chart which receives three numbers, all real numbers, and determines whether the second one lies strictly between the first and third.


1
Expert's answer
2022-02-13T09:42:15-0500
#include <iostream>






int main()
{
    double a, b, c;
    std::cout << "Enter first value : ";
    std::cin >> a;
    std::cout << "Enter second value : ";
    std::cin >> b;
    std::cout << "Enter third value : ";
    std::cin >> c;


    if (b > a && b < c)
    {
        std::cout << "Second value is in the middle\n";
    }
    else
    {
        std::cout << "Second value is not in the middle\n";
    }
    system("pause");
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog