Learn C Language from the Best Tutors

• Affordable fees
• 1-1 or Group class
• Flexible Timings
• Verified Tutors

Search in

# how the right shift operator works on a numerical value?? eg:- 8>>3=?

first convert numerical value to binary value then arrange into bits and shift 3 bit on right then convert binary value to decimal value.

Trainer

as per your example 8>>3 first write 8 in binary format then the binary digits should be shifted 3 times sorry the explanation not allowed here.

Software Development Trainer

x >> y can be seen as x divided by "2 to the power y". Or you can imagine x in binary format, and drop y rightmost digits, adding y 0s at the left.

C coder

8 = 01000 after right shift no = 0001 right most 3 bits will be discarded. output = 1

Result oriented teaching professional

Represent the given number in digital form ...bits of 0s and 1s string...Then,perform the shift operation on MSB digits(most significant digits)...RHS, 3 times...convert to decimal and that's the output.

Computer and Photography Instructor

its a Shift operator and its shifted 3 times in right onwards. all in bit wise. (1000)2 in binary form. after shifting 3 position on rightwords the value is (0001)2 in Decimal value is 1

Software Professional Trainer with 26+ years of Experience in Software Design and Development

Right shift is equivalent to dividing the number by 2. Here 8 >> 1=4 8>> 2=2 8 >> 3 = 1

MCA

This operator shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Copies of the leftmost bit are shifted in from the left

Expert Technical Trainer with 15 years of work experience

The decimal value need to converted to equivalent binary values and then shift right operation is performed

SUDHIR SHARMA - Computer Trainer based On Delhi

Binary of 8 is "1000" and here by this command 3 bits of "1000" will be shifted to right. Hence Binary will be "0001" so your expressions answer will be "0001" i.e. 1

Related Questions

Who founded the C language? Why?
The C programming language was developed by Dennis Ritchie at Bell Labs in the early 1970s. Ritchie, along with Ken Thompson, created C as an evolution of the B programming language, aiming to enhance...
Santosini
Why is C still so popular?
C remains popular for several reasons, and its enduring popularity can be attributed to a combination of historical significance, efficiency, and versatility. Here are some key reasons why C is still widely...
A
Is a default case necessary in a switch statement?
NO, default is optional and you can omit it if there is no use of it.
My
How many programs are in the C language?
Here, we have provided 100+ C programming examples in different categories like basic C Programs, Fibonacci series in C, String, Array, Base Conversion, Pattern Printing, Pointers, etc.
Muskan

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Related Lessons

C Program-String Comparison
// WAP to compare strings entered by the user //Header files #include<stdio.h>#include<conio.h>#include<string.h> //Main function void main(){ char str1; char str2; int comp; //Function...

INTRODUCTION TO PROGRAMMING LANGUAGES
Language is a medium for communication. If we want to perform anything with another person, we can know the human language as a human being. Similarly, if we want to perform anything with a computer, we...

Basics Of C And C++
C++ is powerful, highly flexible, and adaptable programming language that allows software engineers to organise and process information quickly and effectively. But this high-level language is relatively...

Find out the Output of the following with reason and get C Language Training fess less by 10%
1. void main() { clrscr(); printf(5+"Beautifull"); getch(); } 2. void main() { int a=50; clrscr(); ...

Introduction to Programming Languages
What is a Programming Language? A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages...
Find C Language Classes near you

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

### Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

• Select the best Tutor
• Book & Attend a Free Demo
• Pay and start Learning

### Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro