fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a,b,c,d;
  6. cout<<"Enter four distinct numbers\n";
  7. cin>>a>>b>>c>>d;
  8. if(a>b&&b>c&&c>d)
  9. cout<<b;
  10. else if(a<b&&b<c&&c<d);
  11. cout<<c;
  12. else if(a>b&&b<c&&c<d);
  13. cout<<d;
  14. else
  15. cout<<a;
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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
  ^~~~
stdout
Standard output is empty