Question: Write an C language function named computeMagicNumber which will accept a string (name of an individual) as input and compute a magic number from this

Write an C language function named computeMagicNumber which will accept a string (name of an individual) as input and compute a magic number from this argument using the following formula.

Write an C language function named computeMagicNumber which will accept a string

In the above formula, ascii(name[i]) will return the ascii equivalent of a letter.

There is no need for implementing this function in assembly since characters in a string are already represented in ascii.

% is the remainder operation.

name is the string argument passed to the function.

N-1 MagicNun ber-C2(1+1)x(ascii(nameliD)%1001 (it 1) lascii(nameBDI 1961001 i 0

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!