Question #278509

Write a C++ program that prompts the user to input two integers and check whether they are equal or not.


Expert's answer

#include<iostream>
using namespace std;

int main()
{
	int x, y;
	cout << "Please, enter a value x: ";
	cin >> x;
	cout << "Please, enter a value y: ";
	cin >> y;
	if (x == y)
	{
		cout << "Values of x and y are equal!";
	}
	else
	{
		cout << "Values of x and y are not equal!";
	}
}

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!

LATEST TUTORIALS
APPROVED BY CLIENTS