1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
djverab [1.8K]
3 years ago
15

Write a C program that right shifts an integer variable 4 bits. The program should print the integer in bits before and after th

e shift operation. Does your system place 0s or 1s in the vacated bits?
Computers and Technology
1 answer:
Sindrei [870]3 years ago
4 0

Solution :

#include<$\text{stdio.h}$>

#include<conio.h>

void dec_bin(int number) {

$\text{int x, y}$;

x = y = 0;

for(y = 15; y >= 0; y--) {

x = number / (1 << y);

number = number - x * (1 << y);

printf("%d", x);

}

printf("\n");

}

int main()

{

int k;

printf("Enter No u wanted to right shift by 4 : ");

scanf("%d",&k);

dec_bin(k);

k = k>>4; // right shift here.

dec_bin(k);

getch();

return 0;

}

You might be interested in
Which version of Windows was considered an operating environment rather than an operating system? Windows 1.0 Windows 3.0 Window
Goryan [66]
<span>1.0 Windows was considered an operating environment not an operating system</span><span />
6 0
3 years ago
According to the video, what qualities do Human Services workers need? Check all that apply.
Helga [31]

Answer:

patience

understanding

ability to speak in public

willingness to take emotional risks

Explanation:

You are a human service worker, and hence you certainly need to provide the sufferers with the basic needs only. And for that, you do not need confidence or creativity. However, conditions can be challenging, and hence you certainly need the patience, ability to take emotional risks and understanding. Also, you should be good enough to speak in the public as that can be required sometimes. Hence, the correct options are as mentioned above.

5 0
4 years ago
Read 2 more answers
Which administrative tool can you use to check your computer's health or troubleshoot problems with the operating system or soft
Fiesta28 [93]

Answer:

performance monitor

Explanation:

7 0
3 years ago
Read 2 more answers
What does a bonus object do? A. Subtracts lives B. Keeps track of a player's health C. Gives a player an advantage D. Makes text
lyudmila [28]

Answer:

C) Gives a player an advantage

Explanation:

I don't know the context of the question, but it makes the most sense.

5 0
3 years ago
I need urgent help...my laptop has been like this... can anyone help me plzzz​
lukranit [14]

Answer:

I think you have to restart your device.

6 0
3 years ago
Other questions:
  • WHOEVER HELPS ASAP GETS BRAINLiEST!!!!!!!!! :)
    15·2 answers
  • Look at the circuit shown in the figure above. Switch S1 is open as shown, and R1 and R2 each have a value of 100 k. If you conn
    11·1 answer
  • A type of wireless local area network technology​
    7·2 answers
  • Draw a logic circuit for the function F = (A + B)(B + C)(A + C), using NOR gates only. ​
    9·1 answer
  • Which of the following statements are true?
    13·1 answer
  • Write a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters.
    7·1 answer
  • Python will ignore any line of code that begins with hashtag true or false​
    13·2 answers
  • Hmm what should i do with this information
    14·2 answers
  • Write a program that uses a structure to store the following data about a customer account: Name Address City, State, and ZIP Te
    10·1 answer
  • In what ways is the human brain like a computer? In what ways is it different?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!