fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, remainder;
  6.  
  7. cout << "Enter first number: ";
  8. cin >> a;
  9.  
  10. cout << "Enter second number: ";
  11. cin >> b;
  12.  
  13. remainder = a % b;
  14.  
  15. cout << "Remainder of two numbers = " << remainder;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5288KB
stdin
56
6
stdout
Enter first number: Enter second number: Remainder of two numbers = 2