int x = 7;
boolean result = !x && x >= 3;
System.out.println(result);
int x = 7;
boolean result = !x && x >= 3;
System.out.println(result);
nasa basic palang kasi kami paps pano siya icocode kapag ganitong langJava:int x = 7; boolean result = !x && x >= 3; System.out.println(result);
The E×ρréššion "!x" evaluates to false because the logical NOT operator inverts the truth value of the E×ρréššion "x" (which is true since x = 7 is a non-zero integer). The E×ρréššion "x >= 3" evaluates to true since 7 is greater than or equal to 3. Therefore, the overall E×ρréššion "!x && x >= 3" evaluates to false && true, which results in a final value of false.
So the output of the above code would be "false", indicating that the E×ρréššion "!x && x >= 3" is false when x = 7.
nageerror kasi sa compiler na gamit konasa basic palang kasi kami paps pano siya icocode kapag ganitong lang
Java:int x = 7; [/QUOTE] [QUOTE="CR1T CARUZ, post: 25394135, member: 1470322"] boolean result = !x && x >= 3; System.out.println(result);
The E×ρréššion "!x" evaluates to false because the logical NOT operator inverts the truth value of the E×ρréššion "x" (which is true since x = 7 is a non-zero integer). The E×ρréššion "x >= 3" evaluates to true since 7 is greater than or equal to 3. Therefore, the overall E×ρréššion "!x && x >= 3" evaluates to false && true, which results in a final value of false.
So the output of the above code would be "false", indicating that the E×ρréššion "!x && x >= 3" is false when x = 7.
Kung (x != 0) yan. True ang magiging outputnasa basic palang kasi kami paps pano siya icocode kapag ganitong lang
View attachment 2534308
diko kasi siya macode ng tama pero alam kona yung sagot diko lang mapalabas
nageerror kasi sa compiler na gamit ko
pano siya icocode paps without booleanKung (x != 0) yan. True ang magiging output
View attachment 2534330
pano siya icocode paps without boolean