If statement | How If statement works



Write a program that input two numbers and it decide either they are equal or not.

# include <iostream>
using namespace std;

void main() {

       int a;
       int b;


       //get value for a
       cout<<"Please enter the Value of A :";
       cin>>a;

       //get the value for b
       cout<<"Please enter the value of B :";
       cin>>b;
        
            
       if (a == b)
             cout<<"These two values are equal to each other "<<endl;
       else
             cout<<"A and B are not equal to each other"<<endl;
       }

Comments

Popular posts from this blog

Umbrella activities in Software Engineering

Operating System | Best Definition of Opetating System