Write a C program that right shifts an integer variable 4 bits. The program should print the integer in bits before and after the shift operation. Does your system place 0s or 1s in the vacated bits?

Answers

Answer 1

Solution :

#include<[tex]$\text{stdio.h}$[/tex]>

#include<conio.h>

void dec_bin(int number) {

[tex]$\text{int x, y}$[/tex];

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;

}


Related Questions

Which of the following is not the disadvantage of closed
network model?
Select one:
O Flexibility
O Public network connection
O Support
O External access​

Answers

Answer:

public network connection

Answer:

public network connection

What is the hamming distance between the following bits? Sent
bits: 101100111, Received bits: 100111001
Select one: 5. Or 3 or 6 or4​

Answers

I think

the hamming distance between the following bits its 5

Page Setup options are important for printing a PowerPoint presentation a certain way. The button for the Page Setup dialog box is found in the
File tab.
Home tab.
Design tab.
Slide Show tab.

Answers

Answer: Design tab

Explanation:

The page setup simply refers to the parameters which are defined by a particular user which is vital in knowing how a printed page will appear. It allows user to customize the page layout. The parameters include size, page orientation, quality of print,margin etc.

It should be noted that page setup options are vital for printing a PowerPoint presentation in a certain way and the button for the Page Setup dialog box can be found in the design tab.

a) Why is eavesdropping done in a network?
b) Solve the following using checksum and check the data at the
receiver:
01001101
00101000​

Answers

Answer:

An eavesdropping attack is the theft of information from a smartphone or other device while the user is sending or receiving data over a network.

Missing: checksum ‎01001101 ‎00101000

is used for finding out about objects, properties and methods​

Answers

Answer:

science

Explanation:

what is the best plugin for subscription sites?

Answers

Answer:

Explanation:

MemberPress. MemberPress is a popular & well-supported membership plugin. ...

Restrict Content Pro. ...

Paid Memberships Pro. ...

Paid Member Subscriptions. ...

MemberMouse. ...

iThemes Exchange Membership Add-on. ...

Magic Members. ...

s2Member.

Other Questions
Which of these people is the most unreliable?O A. An abstract oneB. A diligent oneC. A capricious oneD. An acrimonious one Can someone help me with this question plz show work. There are 30 students in a class. Which equations represent the situation if the number of boysis b and the number of girls is 7? Select all that apply.A. b x 30 = 7B.b = 30- 7C. b = 30 + 7D. b +7 =30E. b x 7 =30 Need help fast!!!Use the number line to compare the numbers.Drag and drop the numbers to place them in increasing order. Find the sum of the zeros in the following equation:Y=(2x 1) (x + 4) (2x 3) (x 1) Which of these is a reason why people wanted to move out west in the mid-1800s?A) to take advantage of cheap or free landB) to escape religious persecution C) to find jobsD) all of the aboveAnswer: D) all of the above Qu motiva a Benjamn Driscoll a plantar rboles en Marte? Through extensive data collection, quality control experts have verified that the true mean weight of a wrapped Starburst candy is 5.1 grams, as advertised on the package. However, in a class activity where you selected and weighed 8 wrapped Starburst candies you obtained a p-value of 0.003 and concluded that the true mean weight of Starburst candies is not as advertised. What type of error was potentially made in this hypothesis test Container A has 200 Liters of water, and is being filled at a rate of 6 liter per minute. Container B has 500 Liters of water, and is being drained at a rate of 6 liters per minute. How many minutes will it take for both containers to have the same amount of water. 3 feet1 foot2 feetA package is shaped like a right rectangular prism. Use the dimensions shown to find the surface area of this package.A)6 square feetB)12 square feetC)20 square feetD)22 square feet Find x.Do not round your answer.12 cm6 cm does vincent have family members who does art? Choose the correct adverb for the sentence.Sue talked _______ than you did.A. most softlyB. softlyC. more softlyD. softer Analia is a school district manager. Here are some details about two schools in her district for the last school year:School A School BNumber of students 300030003000 400040004000Number of teachers 190190190 380380380Graduation rate 86\%86%86, percent 90\%90%90, percentBudget per student \$10{,}500$10,500dollar sign, 10, comma, 500 \$10{,}000$10,000dollar sign, 10, comma, 000% of students in sports club 62\%62%62, percent 68\%68%68, percentNumber of sports medals won 999 777SAT average 120012001200 105010501050SAT range (max-min) 900900900 700700700Analia wants to know which school has the lower SAT range relative to the resources invested per student (lower, as SAT range is a measure of inequality, which we want to minimize as much as possible).1) Analia thought of two different ways to define this quantity. Identify these two definitions among the following options. Which of the following is evidence that a chemical reaction has occurred? i will need the answer for this aFilling up the pockets with gold coins, Aladdin laughed andlaughed. The underlined part of the sentence is:PhraseB. Conditional ClausePrepositional Phrase D. Grammatical Clause Can someone plz help me on this science its due today and STAAR test is next week Adamson Corporation is considering four average-risk projects with the following costs and rates of return:Project Cost Expected Rate of Return1 $2,000 16.00%2 3,000 15.003 5,000 13.754 2,000 12.50The company estimates that it can issue debt at a rate of rd = 10%, and its tax rate is 30%. It can issue preferred stock that pays a constant dividend of $5 per year at $48 per share. Also, its common stock currently sells for $33 per share; the next expected dividend, D1, is $4.00; and the dividend is expected to grow at a constant rate of 5% per year. The target capital structure consists of 75% common stock, 15% debt, and 10% preferred stock.Required:a. What is the cost of each of the capital components? b. What is Adamson's WACC? . Which rhetorical strategy is used by Brutus: "There is tears for his love, joy for his fortune, honor for his valor, and death for his ambitio