All submissions

Set the Bit in an 8-bit Register

set bit in  bit reg 

Code

#include<stdio.h>
int main ()
{  int reg ,pos;
scanf("%d %d",&reg , &pos);
int result=reg|=(1<<pos);
printf("%d",result);
    return 0;
}

Solving Approach
 

 

 

Loading...

Input

5 1

Expected Output

7