What does C's >>= operation do?

Asked 1 years ago, Updated 1 years ago, 165 views

The school gave it to me as an assignment I don't know what this code is doing or why it's running normally >>>=What is this doing? Why is the output ????

#include <stdio.h>

int main()
{
    int a[2]={ 10, 1 };

    while( a[ 0xFULL?'\0':-1:>>>=a<:!!0X.1P1 ] )
        printf("?");

    return 0;
}

c obfuscation literals bit-shift digraphs

2022-09-21 18:08

1 Answers

while( a[ 0xFULL?'\0':-1:>>>=a<:!!0X.1P1 ] ) If you open one by one,

Replace the double characters :> and <: with and [, respectively while( a[ 0xFULL?'\0':-1] >>=a [!!0X.1P1 ] )

and xfull, 0 is true because , '\ 0' : -? 0 xfull 1 is simple, can simply as 0 is '\ 0' while( a[0] >>=a [!!0X.1P1 ] )

and 0. 1 The 1 p x express floating-point decimal and hexadecimal numbers, 0.125. This is always because it is not zero true as . ! 0. is 1 1 1 p x. while( a[0] >>=a[1] )

> > = operator is going to see. Shift the left prices for a value on the right side of the. A [1] = 1, in reality, while( a[0] >>= 1 ) if you write differently, and while (a [0] / = 2) and the same.

In the first while loop, a[0]/2 = 5-> "?"Output In the second while loop, a[0]/2 = 2-> "?"Output In the third while loop, a[0]/2 = 1-> "?"Output In the fourth while loop, a[0]/2 = 0 -> while statement ends Because of that's why?It will be printed three times.


2022-09-21 18:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.