Question: EDITED*** Hello, I would like help writing a function in the C programming language. The prompt is that a user is asked to enter the
EDITED***
Hello, I would like help writing a function in the C programming language. The prompt is that a user is asked to enter the 3 numbers separated by x's, so that the format would be ##x##x## with each number being in the range of [1, 11], inclusive. The string input by the user, after validated for correctness, must be saved in the correct format as a character array numStr[], and each of numbers must be individually saved as a integer arry nums[]. Refer to the examples below.
NOTE: You can only import stdio.h, string.h, and stdlib.h.
- If any number isn't within the valid range, then user must be prompted again until they enter a valid input.
- The input is considered valid even if it is input with extra spaces.
- Examples of valid inputs: 6x6x6, 3x6x5, 10x5x5, 10 x 3 x 4, 1 0x9x6
- Ex. The user enters "1x6x3", then numStr[] would print to "1x6x3" and nums[] would equal {1, 6, 3}
- Ex. The user enters "11x1x3", then numStr[] would print to "11x1x3" and nums[] would equal {11, 1, 3}
- Ex. The user enters "11 x 1 x 3", then numStr[] would print to "11x1x3" and nums[] would equal {11, 1, 3}
Thanks.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
