+ 3
could someone tell me why it didn't give me 1
#include <stdio.h> int main(){ int x = 43; int y = 65; int result = x & y; printf("%d",result); return 0; }
11 Antworten
+ 7
128 64 32 16 8 4 2 1
0 0 1 0 1 0 1 1 = 43
0 1 0 0 0 0 0 1 = 65
- - - - - - - - - - - -
0 0 0 0 0 0 0 1 = 1
+ 4
Amin, which do you believe is correct, ChatGPT's answer, or yours?
Before you decide, be sure to read the disclaimer on ChatGPT's opening page. 😉
+ 2
BroFar true=1/false=0 is useful if in context of logical &&, but bitwise & may evaluate to other values. In this case the result happens to be 1, because bit0 is the only bit that is in common between 43 and 65.
+ 1
Amin what did you get? It prints 1 for me, as it should.
+ 1
Sorry buddy
It give me 1 too. But Chat GPT tell me that it must be 65 ( a decimal )
+ 1
It gives 1. xD
+ 1
In c language Zero is used to represent false, and One is used to represent true.
+ 1
Robert please do not spam the question and answer forum.
Wrecklessly doing so may get your account suspended or terminated.
+ 1
Это использование побитового метода в языке C.
Kotali KaN
0
Brian this is an example of what I was referencing to in my earlier statement using bitwise in c language.
https://code.sololearn.com/cJoeUTdpn46R/?ref=app
0
Что этов се такое?😂