Three numbers are taken from user and greatest number is displayed.
Select To use this code as it is.. select and copy paste this code into code.cpp file :)
- #include <iostream.h>
- #include <conio.h>
- void main()
- {
- clrscr();
- int a,b,c;
- cout<<"Please enter three nos. ";
- cin>>a>>b>>c;
- if (a>b)
- {
- if (a>c)
- cout<<"a is largest";
- else
- cout<<"c is largest";
- }
- //Coding by: Snehil Khanor
- //http://WapCPP.blogspot.com
- else if (b>c)
- cout<<"b is largest";
- else
- cout<<"c is largest";
- getch();
- }
1 comments:
C++ program to Find Largest Number among three numbers
Thanks for this code, it's very simple and easy.
Post a Comment