evaluate the expression in value :
12 % x
using namespace std;
// The expression 12 % x gives the mod value (remainder when divide by x) of 12 using 'x'
// For example: if x = 5, Then 12 % x = 12 % 5 = 2
// Some examples are given below in code:
main(void)
{
int x,y;
x=5;
y = 12%x;
cout<<"\n\t x = "<<x;
cout<<"\n\t 12 % x = "<<"12 % "<<x<<" = "<<y;
x = 6;
y = 12%x;
cout<<"\n\n\t x = "<<x;
cout<<"\n\t 12 % x = "<<"12 % "<<x<<" = "<<y;
x = 7;
y = 12%x;
cout<<"\n\n\t x = "<<x;
cout<<"\n\t 12 % x = "<<"12 % "<<x<<" = "<<y;
x = 8;
y = 12%x;
cout<<"\n\n\t x = "<<x;
cout<<"\n\t 12 % x = "<<"12 % "<<x<<" = "<<y;
x = 9;
y = 12%x;
cout<<"\n\n\t x = "<<x;
cout<<"\n\t 12 % x = "<<"12 % "<<x<<" = "<<y;
return(0);
}
Comments
Leave a comment