#include <iostream>using namespace std; int main() { int a,b,c,d; cout<<"Enter four distinct numbers\n"; cin>>a>>b>>c>>d; if(a>b&&b>c&&c>d) cout<<b; else if(a<b&&b<c&&c<d); cout<<c; else if(a>b&&b<c&&c<d); cout<<d; else cout<<a; return 0;}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:12:2: error: ‘else’ without a previous ‘if’ else if(a>b&&b<c&&c<d); ^~~~ prog.cpp:14:2: error: ‘else’ without a previous ‘if’ else ^~~~
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!