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]
2 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]2 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
Jesse purchases a new smartphone and is immediately able to use it to send a photo over the Internet to a friend who lives in a
frez [133]

Answer:

D: A single direct connection is established between any two devices connected to the Internet.

Explanation:

The internet is a complex network system made of protocols, packets, and other things. For a network to be connected, it requires the use of multiple pathways. It is unnecessary for a single direct connection because of most of the networks in this real-world travel in multiple direct connections. For example, if you want to go to Brainly.com. It first needs your IP address and then the protocols like HTTP and TCP to send it. Networks are just like traffic. If one section or a part gets blocked, they go on a different path and reach their destination. It is the same here for networks. Networks go into multiple directions to get to their destination. Therefore, a single direct connection is not required or necessary to make it possible.  

8 0
3 years ago
Which of the following is the SECOND step of the intuitive​ lowest-cost method​?
coldgirl [10]

The very first step of the lowest cost method is to find the cell with the lowest cost in the entire matrix representing the cost of transportation along with supply and demand.

C. Find the cell with the lowest cost from the remaining​ (not crossed​ out) cells.

<u>Explanation:</u>

The second step in the lowest cost method is to allocate as many units as possible to that cell (having the lowest cost) without exceeding the supply or demand.

Then cross out the row or column (or both) that is exhausted by the assignment made. These two steps are further repeated until all the assignments are made and the total cost of transportation is calculated at the end.  

3 0
3 years ago
(Giving away points!)
Komok [63]

Answer:

Used to lol not anymore tho :p

8 0
3 years ago
Which step in Gabriel’s process is incorrect?
FinnZ [79.3K]

Answer:

the answer is ;gabriel picked the wrong tab.he needs to select the insert tab ,not the formulas tab to select watch window

5 0
3 years ago
Meeting code =nve-hmqq-qxr<br>​
valentina_108 [34]
Uhhhh meeting code for what
7 0
3 years ago
Read 2 more answers
Other questions:
  • Write a program to calculate how much to tip a waiter person based on the quality of service. The script file should ask for the
    12·1 answer
  • Google Ads was designed to deliver three things to every advertiser: relevance, control, and results. It provides relevance by c
    11·1 answer
  • . The toasting cycle of an automatic toaster is started by A. pushing the bread rack down. B. pushing the start button. C. turni
    14·2 answers
  • Select the correct answer.
    12·1 answer
  • Plot element is typically the turning point in the most intense moment of a story
    8·1 answer
  • Brian has been working for a few years now and has saved a substantial amount of money. He now wants to invest 50 percent of his
    12·2 answers
  • Websites whose URL’s contain tildes (~) are usually published by the government. TRUE or FALSE.
    8·2 answers
  • For BitTorrent, which of the following is true:
    6·1 answer
  • What is a cloud in the world of computing
    7·1 answer
  • How do people and computers approach problems differently
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!