Cursos
Iniciar sesiónComenzar a aprender IA
Cursos
Iniciar sesiónComenzar a aprender IA
0

Why do we get zero for the below equation as we know, 1^1=1 ?

int x = 1; x^=1; cout << x; output ------------- 0

algorithm
28th May 2017, 6:20 PM
John Watson
John Watson - avatar
1 Respuesta
+ 3
The "^" is not "to the power of" in most programming languages. https://stackoverflow.com/questions/14526584/what-does-the-xor-operator-do Try: C++: pow(1,1); or JS: Math.pow(1,1);
28th May 2017, 6:35 PM
Joseph P French
Joseph P French - avatar

¿Tienes a menudo preguntas como esta?

Aprende gratis de forma más eficaz

  • Introducción a Python

    7,1M de estudiantes

  • Introducción a Java

    4,7M de estudiantes

  • Introducción a C

    1,5M de estudiantes

  • Introducción a HTML

    7,5M de estudiantes

Ver todos los cursos
En tendencia hoy
Is anyone else experiencing this Sololearn issue?
0 Votes
Best language?
0 Votes
How do I keep myself motivated in coding
0 Votes
Anyone have song names? Comment your favorites here for a project im working on
1 Votes
Bro can you fix yt error?
0 Votes
Learn - multiple choice course questions display in one box making it impossible to continue
1 Votes
I want to know how to make an Payment App like what I need to learn I need some guidance
0 Votes
Bug in Completing AI Practice
0 Votes
Best Software for Windows Users to Convert RAR to ZIP
0 Votes