Program to find equal values using if statement in C++

Using Visual Studio 2015

===============================================================


#include<iostream>
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

Popular posts from this blog

Suppose you are given a square matrix of size n x n, write a program to determine if this is an identity matrix. 2D array

Program to create a multiplication table of a given number using while loop.