fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int num;
  7. int mul;
  8.  
  9. cout << "Enter a number: ";
  10. cin >> num;
  11.  
  12. if(cin)
  13. {
  14. mul= num*10;
  15. cout << "This is 10 times the numbers " << mul << '\n';
  16. }
  17. else
  18. {
  19. cout << "Input error, bye\n";
  20. return 1;
  21. }
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 2728KB
stdin
abc
stdout
Enter a number: Input error, bye