Skip to content

Correction for the syntax of using (x&1) inside if condition, it should be different for c++ and java. #1

Open
sameer302 wants to merge 1 commit into
wncc:mainfrom
sameer302:patch-1
Open

Correction for the syntax of using (x&1) inside if condition, it should be different for c++ and java. #1
sameer302 wants to merge 1 commit into
wncc:mainfrom
sameer302:patch-1

Conversation

@sameer302

Copy link
Copy Markdown

(x & 1) returns int. In c++ any non-zero int is treated as true but in java there is no implicit conversion and hence we need to compare the int with 0 to include it in if condition.

…n java there is no implicit conversion and hence we need to compare the int with 0 to include it in if condition.

Updated examples for bitwise operators in C++, Java, and Python.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant