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
What does it mean when your phone says system ui has stopped?
wel
It means hat the CPU is taking o much of what the phone can normally do try delete some apps or close apps your not using 
8 0
4 years ago
I connected to an external hard drive to transfer some photos from my vacation. When I try to drag the photo, it bounces right b
Ilia_Sergeevich [38]
Your answer is D.

Hope this helps and if you could answer the question I just uploaded titled giving brainliest that would be great. Basically, what you have to do is research why the book titled the list of things that will not change and explain why it’s your favorite book based on the message it tells you! Go to my profile and go to questions.
7 0
3 years ago
Can someone tell me what this means Higfaa
Arisa [49]

Answer:

it's a Jamaican slang

Explanation:

it depends on the wah it is used

7 0
3 years ago
1.03!! need help!! kinda hard!!
dexar [7]
I think it’s internet sorry if it’s wrong
5 0
3 years ago
The automatically updated properties cannot be changed by a user. True or False ?
kolbaska11 [484]
The answer is false.
6 0
4 years ago
Other questions:
  • The merge process involves which two types of files?
    9·2 answers
  • Modern processors today utilize _____ when fetching instructions as a means of predicting where the branch will go and even begi
    13·1 answer
  • Why is ice even more dangerous than snow
    9·2 answers
  • Space management is a<br> driving method.<br> A. lazy<br> B. defensive<br> C. fast
    14·1 answer
  • Host to IP address lookup and its reverse lookup option are very important network services for any size network. It is also how
    9·1 answer
  • What is modularity? Help asap
    9·1 answer
  • Write an article for publication on why every student should be computer literate​
    13·1 answer
  • Find the errors<br><br> Look to the following code and fix the errors
    9·1 answer
  • Five jobs arrive nearly simultaneously for processing and their estimated CPU cycles are, respectively: Job A = 2 ms, Job B = 12
    7·1 answer
  • What symbol do we use to assign a value to a variable or constant in algorithms?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!