C++ program to check the equality of given numbers
codeaft.cpp
#include<iostream>usingnamespacestd;intmain(){inta,b;cout<<"———————————————————————————————————————————";cout<<"\nProgram to check the equality of given numbers\n";cout<<"———————————————————————————————————————————";cout<<"\nEnter the first number ";cin>>a;cout<<"Enter the second number ";cin>>b;if(a<b){cout<<"\n"<<a<<" is less than "<<b;}elseif(a==b){cout<<"\n"<<a<<" is equal to "<<b;}else{cout<<"\n"<<a<<" is greater than "<<b;}cout<<"\n———————————————————————————————————————————\n";return0;}
Output
codeaft@codeaft:~$ g++ codeaft.cpp codeaft@codeaft:~$ ./a.out
———————————————————————————————————————————
Program to check the equality of given numbers
———————————————————————————————————————————
Enter the first number -10
Enter the second number 10
-10 is less than 10
———————————————————————————————————————————
codeaft@codeaft:~$
Dear User, Thank you for visitng Codeaft. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.