Write a program setbit.c that accepts two integer arguments s and p. If s is equ
ID: 3620511 • Letter: W
Question
Write a program setbit.c that accepts two integer arguments s and p.If s is equal to 1, it sets all the bits of an integer to 1 except for the p-th bit. If s is
equal to 0, it sets all the bits of an integer to 0 except for the p-th bit. Here is the
sample output.
./ setbit 1 0
11111111111111111111111111111110
./ setbit 0 0
00000000000000000000000000000001
./ setbit 0 10
00000000000000000000010000000000
./ setbit 1 10
11111111111111111111101111111111
P.S you don't have to attach any program, just copy and past the C++ program. I'll run it by my own.
Explanation / Answer
please rate - thanksRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.