Answer to Question #188867 in C++ for shila

Question #188867

evaluate the expression in value :


12 % x


1
Expert's answer
2021-05-05T00:25:08-0400
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);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS