if int a=10, and int b=3 what will be the answer of !(a>b) in java
Answers
Answered by
0
Answer:
false
Please mark me as brainliest.
Explanation:
Let us see how the computer reads the program.
In the statements:
int a = 10
int b = 3
it stores the values of the variables.
In the statement:
System.out.println(!(a>b))
it will print the boolean of !(a>b) by replacing the values of a and b. (Note: Without the System.out.println keyword, you won't get output).
! tells it to reverse the boolean in the brackets (a>b).
When it repplaces the values, it finds that 10>3 is true. But because of the ! operator, it prints :
false
Answered by
0
Answer: 'false' will be the output.
Explanation:
- '!' is Logical Not operator which reverse the result, returns false if the result is true.
- int a=10, b=3; here in the given statement a>b.
- !(a>b) will return false as (a>b) is true as '!' operator will reverse the result True into False.
Similar questions