asked 113k views
4 votes
Assign to the boolean variable 'possiblecandidate' the value false if the int variable 'n' is even and greater than 2, or if the variable 'n' is less than or equal to 0; otherwise, assign true to 'possiblecandidate'. assume 'possiblecandidate' and 'n' are already declared and 'n' assigned a value.

2 Answers

1 vote

Answer:

possiblecandidate = true;

if( ( ( n >= 2 ) && ( n % 2 == 0 ) ) || ( n <= 0 ) )

possiblecandidate = false;

Step-by-step explanation:

answered
User Alexalejandroem
by
9.1k points
6 votes
possiblecandidate = true;
if( ( ( n >= 2 ) && ( n % 2 == 0 ) ) || ( n <= 0 ) )
possiblecandidate = false;
answered
User Gouri Joshi
by
8.1k points