Program to find equal values using if statement in C++
Using Visual Studio 2015
===============================================================
using namespace std;
#include<conio.h>
void main()
{
int num1, num2, num3;
cout << "Enter first number= ";
cin >> num1;
cout << "Enter second number= ";
cin >> num2;
cout << "Enter third number= ";
cin >> num3;
if (num1==num2)
{
cout <<"\nFirst number is equal to second number";
}
if (num1 == num3)
{
cout <<"\nFirst number is equal to third number";
}
if (num2 == num3)
{
cout <<"\nSecond number is equal to third number";
}
_getche();
}
==========================================================================
Comments
Post a Comment