Types and keyboard input

# Types and keyboard input

- 2
Unavailable

Comments (11)

- Popular
- New
- Old

You must be signed in to leave a comment

ghost

27 October, 19:18

In Java, you can get the length of the string "hello" with this statement: ??

0

Jelly bean

27 September, 18:32

i doubt this 5/2 gives 2.5 or does it, is it 2 or something

+3

Maksim Krasnov

12 June, 20:24

5/2 = 2 // 2 fits twice in 5
5%2 = 1 // remainder - whole number after division
5 = 2*2 + 1
--------------
2/5 = 0 // 5 fits zero times in 2
2%5 = 2 // remainder - whole number after division
2 = 0 +2

+1

Tönnes

5 June, 05:53

5%2 question is either bugged or I'm seriously misunderstanding what a modulo does when I get the answer 5 :D If 2 were the right answer it should be 2%5, no? :D

0

Anonymous #10882853

27 December 2021, 19:43

very nice java in the dance floor

0

Lauren Millyard

12 October 2021, 11:10

% here, stands for modulo, which returns the remainder of the division of two numbers
so for example
the result of 6 modulo 2 would be 0 (there is nothing left over from 6/2)
7%2 = 1 (you can divide 7 by 2 three times and there would be 1 left over)

+3

Tönnes

5 June, 05:50

My question was "what is the evaluation of 5%2" and the answers were 1, 2, 2.5, 3 :D I mean, 5 but what the heck :D

0

sumit singh

6 August, 07:28

the answer would be 1 because that will be the remainder when we divide 5 by 2.
and modulo operator gives us the same.

+1

jason reid

3 October 2021, 14:51

i didnt read anything about 5%2

+1

ConnerMcFly

13 October 2021, 08:55

Yes it wasnt mentioned in a text before this quiz. But I am sure it will be coming soon.

0

Tönnes

5 June, 05:53

It was mentioned in a previous lesson but either the question or the answers are wrong :D

0