Menu mobile
Home
Programming
Python Tutorial
Java Tutorial
C Tutorial
C++ Tutorial
Web Technology
HTML
CSS
Java Script
PHP
React JS
Node JS
Assignment
MS Office
HTML
CSS
Bootstrap
Java Script
JQuery
AngularJs
Project
Blog
Report Bug
QusWhat does ~~~~~~5 evaluate to? Qus ~~~~~~5 का मूल्यांकन किससे होता है?
A. +5
B. -11
C. +11
D. -5
Solution
A. +5
Explanation
The expression ~~~~~~5 evaluates to 5.
In Python, the ~ operator is the bitwise NOT operator, which inverts all the bits of its operand. When applied to an integer n, it computes -(n + 1).
Here's a step-by-step breakdown of the evaluation:
~5 evaluates to -(5 + 1), which is -6.
~~5 evaluates to ~~5. Since ~5 is -6, applying ~ again: ~-6 evaluates to -(-6 + 1), which is 5.
This pattern continues: each pair of ~ operators cancel each other out. Since there are an even number of ~ operators in ~~~~~~5 (six in total), they all cancel out, leaving the original number, which is 5.
Latest Current Affairs 2025
Online Exam Quiz for One day Exam
Online Typing Test
CCC Online Test 2025
Python Programming Tutorials
Best Computer Training Institute in Prayagraj (Allahabad)
Best Java Training Institute in Prayagraj (Allahabad)
Best Python Training Institute in Prayagraj (Allahabad)
O Level Online Test in Hindi
Bank SSC Railway TET UPTET Question Bank
career counselling in allahabad
Sarkari Naukari Notification
Best Website and Software Company in Allahabad
Sarkari Exam Quiz