greatest number among two numbers in C++
#include<iostream>
using namespace std;
int main()
{
int num1,num2;
cout<<"Enter first number ";
cin>>num1;
cout<<"Enter second number ";
cin>>num2;
cout<<"\t Program to find greatest number among two numbers\n";
if(num1>num2)
{
cout<<"1st number is greater";
}
else
cout<<"2nd number is greater";
}
output
Enter first number 3
Enter second number 7
Program to find greatest number among two numbers
2nd number is greater
Comments
Post a Comment