Program in C++ to find the greatest number among four given numbers
#include<iostream> #include<conio.h> using namespace std; int main() { int a,b,c,d; cout<<"Enter 4 nos.:-", cin>>a>>b>>c>>d; if(a>b&&a>c&&a>d) cout<<a<<" is greater."; else if(b>c&&b>d) cout<<b<<" is greater."; else if(c>d) cout<<c<<" is greater."; else cout<<d<<" is greater."; return 0; getch(); }Output:-
0 Comments