Write a program to find the greatest number out of the 2 numbers inputted by the user.

 

#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();

int a,b;

cout<<"Enter value of a:";
cin>>a;
cout<<"Enter value of b:";
cin>>b;

if(a>b)
cout<<"a is greater than b";
else
cout<<"b is greater than a";

getch();
}

 

< Back