Draw a flow chart which receives three numbers, all real numbers, and determines whether the second one lies strictly between the first and third.
#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;
}
Comments
Leave a comment