Created
November 8, 2015 18:13
-
-
Save nalin-adh/d57a6ad7c08f1ee0807e to your computer and use it in GitHub Desktop.
A C++ program that finds smallest among four numbers using conditional operator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<conio.h> | |
using namespace std; | |
int main() | |
{ | |
int a,b,c,d,l; | |
cout<<"a="; | |
cin>>a; | |
cout<<"b="; | |
cin>>b; | |
cout<<"c="; | |
cin>>c; | |
cout<<"d="; | |
cin>>d; | |
l=a>b?a:b; | |
l=l>c?l:c; | |
l=l>d?l:d; | |
cout<<"Greatest number="<<l<<endl; | |
getch(); | |
return(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment