C++ int type Finding the Remainder Between Two Numbers

Description

C++ int type Finding the Remainder Between Two Numbers

#include <iostream> 
using namespace std; 
  
int main(int argc, const char * argv[]) 
{ 
        cout << "Enter your first number: " << endl; 
        int number1 = 0; 
        cin >> number1; /* w  w  w . j  a  v  a2s  .c om*/
  
        cout << "Enter your second number: " << endl; 
        int number2 = 0; 
        cin >> number2; 
  
        int result = number1 % number2; 
        cout << "The remainder from dividing your second number into your first is: " 
                << result << endl; 
        return 0; 
}



PreviousNext

Related