Determine the output of the following program: the % operator - C++ Operator

C++ examples for Operator:Arithmetic Operator

Description

Determine the output of the following program: the % operator

Demo Code

#include <iostream>
using namespace std;
int main()  // a program illustrating the % operator
{
   cout << "The remainder of 9 divided by 4 is " << 9 % 4;
   cout << "\nThe remainder of 17 divided by 3 is " << 17 % 3;
   return 0;//from  w w w. j  a v  a2 s .  c  o m
}

Result


Related Tutorials