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 is the difference between a hard drive and a tape drive? Hard drives use magnetic heads and are fast to write data; tape dr
liraira [26]

Answer:

A tape drive provides sequential access storage, unlike a hard disk drive, which provides direct access storage. A disk drive can move to any position on the disk in a few milliseconds, but a tape drive must physically wind tape between reels to read any one particular piece of data.

Explanation:

Architecturally tape drives are sequential storage, meaning that if you need to access some data at the end of the tape you needed to seek to the end and retrieve it. This can take seconds or minutes. Disks, OTOH are random access. Some hard drives use rotating media and movable heads , so the seek times are instantaneous , at least compared with tape drives. However, like tapes, there is a big advantage to using a rotating hard drive as sequential storage. It takes time, measured in milliseconds, for a head to move to another track. So traditionally, random access is much slower than sequential access.

SSDs have no internal moving parts so random access occurs in the same time frame as sequential access. Moreover, these drives usually have very high performance. For example, they can saturate a SATA data link, meaning that the SATA connection to the motherboard is now a bottleneck in disk access.

At one time tape drives were very popular. They were a low-cost alternative to using disks as backup. They were especially useful when IBM invented the Winchester “fixed” drive. This meant that the hard drive is fixed within its enclosure like they are today. Prior to this one could remove the drive pack and replace it. This was helpful when upgrading to a new version of the operating system as it was simple to replace the older drive pack should there be a problem.

Tape drives can be used in larger data centers, due to the fact that tape volumes can be removed and replaced so that the actual tape drive can backup many disk sets. Also the tape volumes can be stored off-site or in a fire-proof vault so this is valuable in a data recovery scenario.

4 0
3 years ago
A radio station records an interview with a computer scientist using a computer and audio recording software. Explain how sampli
andrew-mc [135]

The way sampling is used to store audio recordings are:

  • Sound capture.
  • converting digital signal.
  • sound wave capture, etc.

<h3>How is sampling used to store audio recordings?</h3>

In this process,  sound is taken in by the use of a microphone and so it is later converted into a digital signal.

Note that an analogue-to-digital converter is often used to taken in or capture a sound wave at frequent  time intervals. This recording is then regarded as a sample and the data is stored in a file for future use.

Learn more about interview  from

brainly.com/question/8846894

#SPJ1

4 0
2 years ago
You have just installed a new NIC in your PC to replace the old one that had started malfunctioning. What additional software mu
miskamm [114]

Answer:

The additional software that must be installed is a device driver.  

Explanation:

Device driver is a software program that is used to control a device connected to a computer.

If a user later buys a new type of device that the operating system did not recognize, new device driver will have to be installed just as in the given question when new NIC is installed. Device driver allows communication between hardware device and operating system.

So device driver will allow the OS to communicate with the new installed NIC.

4 0
3 years ago
In which way is a worm different from a virius
dangina [55]
A worm as a multicell organism, but a virus is a single cell.
3 0
4 years ago
Routines will depend on the ______________________ and is found in every program you write.
kari74 [83]

Answer:

Open an application (Word, PowerPoint, etc.) and create a new file like you normally would. ...

Click File.

Click Save as.

Select Box as the location where you'd like to save your file. If you have a particular folder that you'd like to save it to, select it.

Name your file.

Click Save.

Explanation:

3 0
3 years ago
Other questions:
  • Why did LISD had to block the game “among us”?
    8·2 answers
  • Which button is used to open the Start menu in Windows Vista?
    14·1 answer
  • ​ Search engines can perform date-filtered searches because, when web servers send a webpage to a ____, they include a header th
    11·1 answer
  • Anderson uses his computer and internet link to chart the movement of his favorite 46 stocks. He buys and sells according to the
    15·1 answer
  • Why was the term personal computer created?
    5·1 answer
  • By using the internet, your company can obtain discounts thorugh...
    15·2 answers
  • What are minimum computer requirements for a software program?
    5·1 answer
  • A _____ is relatively inexpensive to install and is well-suited to workgroups and users who are not anchored to a specific desk
    14·1 answer
  • A technician is installing RG6 cable and asks you to retrieve a connector from the parts drawer. What type of connector do you n
    10·1 answer
  • Which very high-speed fiber network was already in place and being used for wide area networking (wan) transmissions, before the
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!