answersLogoWhite

0


Best Answer

The number is divided by 4.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the effect of shifting an unsigned number in a register two bits to the right?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What if -1 is assigned to a unsigned variable in C plus plus?

If you assign -1 to a unsigned variable it will contain the biggest number its able to hold. For example if you assign -1 to a unsigned int it will be 4294967295 as its the biggest number a unsigned int can hold.


What is a program that calculates the sum of any 5 digit integer number entered by user?

#include<iostream> unsigned sum_of_digits(unsigned num) { unsigned sum = 0; do { sum += num%10; } while (num/=10); return sum; } int main() { unsigned number = 12345; unsigned sum = sum_of_digits (number); std::cout << "Sum of digits in " << number << " is " << sum << std::endl; }


C plus plus program to list all Armstrong number?

#include<iostream> #include<vector> unsigned count_digits (unsigned num, const unsigned base=10) { unsigned count=1; while (num/=base) ++count; return count; } class number { std::vector<unsigned> value; unsigned base; public: number (const unsigned _value, const unsigned _base=10): value {}, base {_base} { *this = _value; } number& operator= (const unsigned _value); operator unsigned () const; bool is_narcissistic () const; }; number& number::operator= (unsigned _value) { unsigned count = count_digits (_value, base); value.resize (count); while (count) { value[value.size()-count--] = _value%base; _value/=base; } return *this; } number::operator unsigned () const { unsigned num = 0; for (unsigned index=0; index<value.size(); ++index) num += value[index]*static_cast<unsigned>(std::pow (base, index)); return num; } bool number::is_narcissistic () const { unsigned num = 0; for (unsigned index=0; index<value.size(); ++index) num += static_cast<unsigned>(std::pow (value[index], value.size())); return num == static_cast<unsigned> (*this); } unsigned main() { const unsigned min=1; const unsigned max=100; std::cout << "Narcissistic numbers in the range " << min << " through " << max << ":\n\t"; for (unsigned n=min; n<=max; ++n) if (number(n).is_narcissistic()) std::cout << n << ' '; std::cout << '\n' << std::endl; }


What number system is used to display a memory address?

it is decimal unsigned number system...


What is the program for palindrome numbers from 500 to 100?

#include<iostream> // forward declarations... unsigned reverse (unsigned, const unsigned base = 10); bool is_palindrome (const unsigned); // the program... int main (void) { const unsigned max {500}; const unsigned min {100}; std::cout << "Palindromes from " << max << " to " << min << std::endl; for (unsigned num {max}; num>=min; --num) { if (is_palindrome (num)) { std::cout << num << std::endl; } } } // Returns the reverse of a number using the given base (default: base 10) // Note: trailing zeroes do not become leading zeroes so reverse (100) returns 1 not 001. // However, the reverse of 0 is obviously 0. unsigned reverse (unsigned num, const unsigned base /* = 10 */) { unsigned rev {}; // zero-initialised while (num) { rev *= base; rev += num % base; num /= base; } return rev; } // If the reverse of a number is the same number, that number is a palindrome. // All single-digit numbers are palindromes, including 0. bool is_palindrome (const unsigned num) { return num == reverse (num) ; }

Related questions

Which one is equivalent to multiplying by 2Left shifting a number by 1 or Left shifting an unsigned int or char by 1?

The second.


Difference between signed number from unsigned number?

a signed number is one that can be negative (have a sign) whereas an unsigned number will only be positive. due to less information, you can double the largest number storable in a signed integer to get the data available in an unsigned integer. However, PHP doesn't have unsigned integers, they're all signed.


What if -1 is assigned to a unsigned variable in C plus plus?

If you assign -1 to a unsigned variable it will contain the biggest number its able to hold. For example if you assign -1 to a unsigned int it will be 4294967295 as its the biggest number a unsigned int can hold.


What is a program that calculates the sum of any 5 digit integer number entered by user?

#include<iostream> unsigned sum_of_digits(unsigned num) { unsigned sum = 0; do { sum += num%10; } while (num/=10); return sum; } int main() { unsigned number = 12345; unsigned sum = sum_of_digits (number); std::cout << "Sum of digits in " << number << " is " << sum << std::endl; }


C plus plus program to list all Armstrong number?

#include<iostream> #include<vector> unsigned count_digits (unsigned num, const unsigned base=10) { unsigned count=1; while (num/=base) ++count; return count; } class number { std::vector<unsigned> value; unsigned base; public: number (const unsigned _value, const unsigned _base=10): value {}, base {_base} { *this = _value; } number& operator= (const unsigned _value); operator unsigned () const; bool is_narcissistic () const; }; number& number::operator= (unsigned _value) { unsigned count = count_digits (_value, base); value.resize (count); while (count) { value[value.size()-count--] = _value%base; _value/=base; } return *this; } number::operator unsigned () const { unsigned num = 0; for (unsigned index=0; index<value.size(); ++index) num += value[index]*static_cast<unsigned>(std::pow (base, index)); return num; } bool number::is_narcissistic () const { unsigned num = 0; for (unsigned index=0; index<value.size(); ++index) num += static_cast<unsigned>(std::pow (value[index], value.size())); return num == static_cast<unsigned> (*this); } unsigned main() { const unsigned min=1; const unsigned max=100; std::cout << "Narcissistic numbers in the range " << min << " through " << max << ":\n\t"; for (unsigned n=min; n<=max; ++n) if (number(n).is_narcissistic()) std::cout << n << ' '; std::cout << '\n' << std::endl; }


What is the maximum number in unsigned 16-bits?

65536


What number system is used to display a memory address?

it is decimal unsigned number system...


How do you calculate the number of digits in an integer value using c programme?

#include <math.h> inline unsigned int get_num_digits(const unsigned int n) { return ((unsigned int) log10(n) + 1); }


What is the program for palindrome numbers from 500 to 100?

#include<iostream> // forward declarations... unsigned reverse (unsigned, const unsigned base = 10); bool is_palindrome (const unsigned); // the program... int main (void) { const unsigned max {500}; const unsigned min {100}; std::cout << "Palindromes from " << max << " to " << min << std::endl; for (unsigned num {max}; num>=min; --num) { if (is_palindrome (num)) { std::cout << num << std::endl; } } } // Returns the reverse of a number using the given base (default: base 10) // Note: trailing zeroes do not become leading zeroes so reverse (100) returns 1 not 001. // However, the reverse of 0 is obviously 0. unsigned reverse (unsigned num, const unsigned base /* = 10 */) { unsigned rev {}; // zero-initialised while (num) { rev *= base; rev += num % base; num /= base; } return rev; } // If the reverse of a number is the same number, that number is a palindrome. // All single-digit numbers are palindromes, including 0. bool is_palindrome (const unsigned num) { return num == reverse (num) ; }


Find the sum of digits of given number in C plus plus?

#include<iostream> unsigned sum_of_digits(unsigned num) { unsigned sum = 0; do { sum += num%10; } while(num/=10); return sum } int main() { unsigned num = 42; unsigned sum = sum_of_digits (num); std::cout << sum; // output: 6 }


What is the largest number that can be stored in 16bits?

32767 signed, 65535 unsigned.


How do you write a C program to check whether a number is prime or not and to find the nth prime number?

int number; int i=2; while (i<number) { if(number%i==0) { printf("Not a prime no."); break; } else printf("number entered is prime"); getch(); }