fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int num1, num2, difference, product;
  6.  
  7. cout << "Enter first number: ";
  8. cin >> num1;
  9.  
  10. cout << "Enter second number: ";
  11. cin >> num2;
  12.  
  13. difference = num1 - num2;
  14. product = num1 * num2;
  15.  
  16. cout << "Difference: " << difference << endl;
  17. cout << "Product: " << product << endl;
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5320KB
stdin
5×2
stdout
Enter first number: Enter second number: Difference: 5
Product: 0