Write a C++ program that prompts the user to input two integers and check whether they are equal or not.
#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!";
}
}
Comments
Leave a comment