Write a program that will ask the user for three different numerical values. The program should then decide whether the values are equally spaced. C++

Respuesta :

Answer:

See the code in the Eplanation

Explanation:

// Online C++ compiler to run C++ program online

#include <iostream>

using namespace std;

int main() {

  int firstNumber;

  int secondNumber;

  int thirdNumber;

 

 

cout<< "Enter the firstNumber: ";

cin >> firstNumber;

cout << "Enter the secondNumer: ";

cin >> secondNumber;

cout << "Enter the thirdNumber: ";

cin >> thirdNumber;

int upperbound= abs(firstNumber-secondNumber);

int lowerbound= abs(secondNumber-thirdNumber);

if (lowerbound==upperbound){

cout << "The Three Numbers are Equally spaced";

   

}

  else{

      cout << "The Three Numbers are NOT Equally spaced";

}

}

ACCESS MORE