Demonstrate remainder operator - C++ Operator

C++ examples for Operator:Arithmetic Operator

Description

Demonstrate remainder operator

Demo Code

#include <iostream>
using namespace std;
int main()//from  ww  w .  jav a  2 s .  co  m
{
   cout <<  6 % 8 << endl    // 6
   <<  7 % 8 << endl    // 7
   <<  8 % 8 << endl    // 0
   <<  9 % 8 << endl    // 1
   << 10 % 8 << endl;   // 2
   return 0;
}

Result


Related Tutorials