fork download
  1. double num1, num2, quotient;
  2. cout
  3. << "Enter a number: ";
  4. cin
  5. >> num1;
  6. cout << "Enter another number: ";
  7. cin >> num2;
  8. if (num2 == 0)
  9. cout << "Division by zero is not possible.
  10. \
  11. n";
  12. cout << "Please run the program again ";
  13. cout << "and enter a number besides zero.
  14. \
  15. n";
  16. else
  17. quotient = num1 / num2;
  18. cout << "The quotient of " << num1 <<
  19. cout << " divided by " << num2 << " is ";
  20. cout << quotient << endl;
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<<’ token
 << "Enter a number: ";
 ^~
prog.c:5:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘>>’ token
 >> num1;
 ^~
prog.c:6:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<<’ token
 cout << "Enter another number: ";
      ^~
prog.c:7:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘>>’ token
 cin  >> num2;
      ^~
prog.c:8:1: error: expected identifier or ‘(’ before ‘if’
 if (num2 == 0)
 ^~
prog.c:9:9: warning: missing terminating " character
 cout << "Division by zero is not possible.
         ^
prog.c:9:9: error: missing terminating " character
 cout << "Division by zero is not possible.
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:11:2: warning: missing terminating " character
 n";
  ^
prog.c:11:2: error: missing terminating " character
 n";
  ^~
prog.c:13:9: warning: missing terminating " character
 cout << "and enter a number besides zero.
         ^
prog.c:13:9: error: missing terminating " character
 cout << "and enter a number besides zero.
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:13:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<<’ token
 cout << "and enter a number besides zero.
      ^~
prog.c:15:2: warning: missing terminating " character
 n";
  ^
prog.c:15:2: error: missing terminating " character
 n";
  ^~
prog.c:18:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<<’ token
 cout << "The quotient of " << num1 <<
      ^~
prog.c:20:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<<’ token
 cout << quotient << endl;
      ^~
stdout
Standard output is empty