christianbabona christianbabona
  • 19-03-2017
  • Computers and Technology
contestada

If num is an int which expression always evaluates to true if num holds an odd number

1) Num%2==0
2)Num%2 <0
3)Num%2==1
4)Num/2==1

Respuesta :

xjkbel
xjkbel xjkbel
  • 20-03-2017

The answer is 2) Num%2==1.
The modulus operator (%) divides the left hand side by the right hand side and returns the remainder.

Examples:
3%2=1 : 2 goes into 3 once, with 1 remaining.

5%2 =1 :  2 goes into 5 twice, with 1 remaining.

11%2 =1 :  2 goes into 11 five times, with 1 remaining.

Answer Link

Otras preguntas

All of the following were true of the Lusitania's sinking except:________ A) It caused the deaths of more than 100 Americans on board. B) It was carrying forty
how did the conflicts begin after the signing of the treaty of fort laramie
1/3 times blank equals 2/5
2. Where are valence electrons located?
When light goes from glass to air at some angle, which angle is bigger? A. Refraction B. Reflection C. Diffraction D. Incidence
Fishing hook E is at -7.1 feet it descends another 3.25 feet what it’s depth now
What is the equation of a horizontal line that goes through the coordinate (4,-2)
why was the festival of corpus christi unique and so popular in the medieval Europe?
Oats are eaten by humans as oatmeal or rolled oats, and as feed for livestock such as cattle. In order for an oat plant to make the part we eat (the seed), it m
In a common but dangerous prank, a chair is pulled away as a person is moving downward to sit on it, causing the victim to land hard on the floor. Suppose the v