Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ Quotient and Remainder

    int a, b, c, d;

    cout << "Input the dividend" << endl;
    cin >> a;
    cout << "Input the divisor" << endl;
    cin >> b;

    c = a / b;
    d = a % b;

    cout << "The quotient is: " << c << endl;
    cout << "The remainder is: "<< d << endl;
 
PREVIOUS NEXT
Tagged: #Quotient #Remainder
ADD COMMENT
Topic
Name
6+3 =