c mod function code example
Example 1: modulo c++
#include <iostream>
using namespace std;
int main() {
cout << 11%3; // Prints 2
}
Example 2: find mod in cpp
// Mode(%) => to get remainder
1 % 10 = 1
2 % 10 = 2
10 % 10 = 0
#include <iostream>
using namespace std;
int main() {
cout << 11%3; // Prints 2
}
// Mode(%) => to get remainder
1 % 10 = 1
2 % 10 = 2
10 % 10 = 0