fork download
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7.  
  8. double num , max, min ;
  9. char ch;
  10. cout<<"Enter numbers ... Type ((q)) to show results "<<endl;
  11. cin >> num;
  12. max=num;
  13. min=num;
  14. for (;;)
  15. {
  16. cin >> num;
  17. ch=getch();
  18. if (ch=='q')
  19. break;
  20. if (num > max)
  21. max=num;
  22. else if (num < min)
  23. min=num;
  24. }
  25. cout << "maximum is "<<max<<" and minimum is "<<min;
  26. return 0;
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:19: error: conio.h: No such file or directory
prog.cpp: In function ‘int main()’:
prog.cpp:17: error: ‘getch’ was not declared in this scope
stdout
Standard output is empty