Question: Please write this functions in C code language Function 1 : int isNumber(char *c) Function should return 1 is the argument passed is a digit

Please write this functions in C code language

Function 1 :

int isNumber(char *c) Function should return 1 is the argument passed is a digit and zero otherwise. Please note the asci equivalents of numeric characters from an asci table.

Function 2 :

Given the following C function prototype that accepts two integer arguments. Complete the function and return 1 if a > b , return -1 if a < b and return 0 if a is equal to b. int compare(int a, int b)

Function 3 :

Given the following C function prototype which accepts an integer argument, complete the implementation of the function to return the number of 1s in the binary representation of the number passed. For example if the number is (011100011 ) then the function should return 5 as the number of 1s. Please remember that an integer is 32 bits long. int countOnes(int number)

Function 4:

Write a C language function to determine the hamming distance ( the number of different bits) between two characters passed as parameter. Please note that the function prototype is given below. int returnHammingDistance( char firstparameter, char secondparameter)

NOTE: (defining Hamming Distance) for function #4

The Hamming distance between two integers or strings is the number of positions at which the corresponding symbols differ. It is used in telecommunication to count the number of flipped bits in a fixed-length binary word as an estimate of error, and therefore is sometimes called the signal distance. Hamming distance is the count of minimum number of bits that need to be inverted in order to change one number into the other. Example: Hamming distance between the two numbers: 11110100 and 10100101 1 1 1 1 0 1 0 0 1 0 1 0 0 1 0 1 The highlighted 3 bits differ from each other in the given example, and thus, its hamming distance is 3.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!