Question: Write a programming C that creates one thousand strings of 128 random characters and numbers, one at a time, and stored in a character array

Write a programming C that creates one thousand strings of 128 random characters and numbers, one at a time, and stored in a character array str[129].

The program should use rand() to store either a letter (A to Z and ato z) or digit (0 to 9) at all 128 positions in the string. Use the results of rand() in such a way that there should be about an equal probability of each position in the string being either a letter or a digit.

After creating each new string, the program should display the first n characters which are all valid hexadecimal digits and print out the decimal equivalent for the hex digits.

The program should also display at completion the largest and smallest hexadecimal numbers that the program created from a continuous sequence of the first n characters of each string.

For example, if the program generated the string str=12A7C4J23EF9MQ2 on the seventh loop, it should display something like HexValue[7] = 0x12A7C4 = 1,222,596 Decimal

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!