modulus.cpp

We use cookies. Read the Privacy and Cookie Policy

modulus.cpp

#include ‹iostream.h›

#include ‹stl.h›

int input1[4] = {6, 8, 10, 2};

int input2[4] = {4, 2, 11, 3};

int main() {

 int output[4];

 transform(input1, input1 + 4, input2, output, modulus‹int›());

 for (int i = 0; i ‹ 4; i++) cout ‹‹ output[i] ‹‹ endl;

 return 0;

}