What is the 8-bit binary 2's complement representation of the decimal value -37?
1101 1011
Given the function declaration: int numUChars(char * str); This function returns the number of upper case characters in the string str. Write the body of this function.
#include<string.h>
intnumUChars(char*str) {
int n =0;
while (*str) {
if (str >='A'&& str <='Z') {
n++;
}
str++;
}
return n;
}
Write a C function that takes an unsigned integer parameter and returns 2.5 times that value without using any multiplication or division operators. For example, if the parameter has a value of 16, the result should be 40.
weight in carat with 4 bits to the right of the decimal point
this gives range up to 4096
milligrams --200 milligrams is one carat
carat scale is most common scale for diamonds
range is little larger than largest diamond ever found: 3167 carats
0x0001 is 1/16 of a carat
0xffff is 4095.9375 carats