4. Set the Bit in an 8-bit Register

Back To All Submissions
Previous Submission
Next Submission

Code

#include <stdio.h>

int main() {
    

    unsigned int reg,pos;

scanf("%u%u",&reg,&pos);

  unsigned int result = reg | (1<<pos);

  printf("%u",result);
    
    return 0;
}

Solving Approach
 

 

 

Was this helpful?
Upvote
Downvote