write a program to find greatest of two numbers

Two numbers are taken from user and greatest of two is determined.


Select To use this code as it is.. select and copy paste this code into code.cpp file :)



  1. #include <iostream.h>
  2. #include <conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. int a,b;
  7. cout<<"Please enter two nos. ";
  8. cin>>a>>b;
  9. //Coding by: Snehil Khanor
  10. //http://WapCPP.blogspot.com
  11. if (a>b)
  12. cout<<"a is greatest";
  13. else
  14. cout<<"b is greatest";
  15. getch();
  16. }

Check out this stream