3
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by BestJewSinceJC
0

Hi jackieoh and welcome to DaniWeb :)

Not sure exactly what your question means, but if you want to output "%" character to the console you do this:

System.out.print("%");

If that's not what your question meant, please let us know what you are trying to do.

0

Hi jackieoh and welcome to DaniWeb :)

Not sure exactly what your question means, but if you want to output "%" character to the console you do this:

System.out.print("%");

If that's not what your question meant, please let us know what you are trying to do.

I am trying to debug some exercises. One line says: result =
a % b; I am lost. It keeps saying that I am loosing precision. this is all new to me and i am lost. LOL

0

I am trying to debug some exercises. One line says: result =
a % b; I am lost. It keeps saying that I am loosing precision. this is all new to me and i am lost. LOL

Forgive me for not thanking you for the welcome.

0

So that's how I write it in debugging exercise?

The % or modulus operator gives, as its answer, the remainder after division. So 3 % 3 = 0 and 3 % 2 = 1 and 11 % 3 = 2

0
int a = 5;
int b = 3;
int result = a % b;
System.out.println(result); //prints 2

If you need to know anything else, ask a better question.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.