111k views
4 votes
Write an expression that evaluates to true if and only if the value of the integer variable workedOvertime is true.

User T Anna
by
8.0k points

1 Answer

5 votes

Answer:

The expression of this question can be given as:

(workedOvertime == true)

Explanation:

This question explains by the following example that is written in C language can be given as:

#include <stdio.h> //header file.

int main() //main function.

{

int workedOvertime=10; //define integer variable

int true=10;

if(workedOvertime==true) //check condition.

{

printf("true.."); //true part code.

}

else

{

printf("false.."); //false part code.

}

return 0;

}

In the above example there we define a integer variable name(workedOvertime) in this variable we assign a value. And we define another variable true in that we also assign a value. then we use if-else statement that is used for checking the value. If block always execute true value.So the answer is true.and the Expression is (workedOvertime==true).

User Jean Robert
by
8.2k points