Tuesday 7 July 2020

IF Statements IN C++

IF Statements IN C++ 

How To Compare Two Numbers in C++ Using If Statements:
Code:
#include <iostream>

using namespace std;

  int  main()
  {
  int num1;
  int num2;
  cout<<"Enter The Number 1"<<endl;
  cin>>num1;
  cout<<"Enter The Number 2"<<endl;
  cin>>num2;
  if(num1==num2){
  cout<<"Numbers are eqaul"<<endl;
 
  }
  esle
  {
  cout<<"Numbers are not equal"<<endl;
  }
  return 0;
 

  }

No comments:

Post a Comment