C / C++ लाइब्रेरी फंक्शन div_t div(int numer, int denom) डिनोम (डिनोमिनेटर) से डिवाइडर (अंश) होता है। Div () फ़ंक्शन के लिए घोषणा निम्नलिखित है।
div_t div(int numer, int denom)
पैरामीटर अंश और हर हैं। यह फ़ंक्शन
उदाहरण
#include <iostream>
#include <cstdlib>
using namespace std;
int main () {
div_t output;
output = div(27, 4);
cout << "Quotient part of (27/ 4) = " << output.quot << endl;
cout << "Remainder part of (27/4) = " << output.rem << endl;
output = div(27, 3);
cout << "Quotient part of (27/ 3) = " << output.quot << endl;
cout << "Remainder part of (27/3) = " << output.rem << endl;
return(0);
} आउटपुट
Quotient part of (27/ 4) = 6 Remainder part of (27/4) = 3 Quotient part of (27/ 3) = 9 Remainder part of (27/3) = 0