C programming

  1. profile image47
    nassarbasharposted 7 years ago

    C programming

    Write a program that takes an integer keyed in from the terminal and extracts and
    displays each digit of the integer in English. So, if the user types in 932, the program
    should display
    nine three two
    Remember to display “zero” if the user types in just a 0.

  2. simeonvisser profile image83
    simeonvisserposted 7 years ago

    We don't do homework really. But how is your attempt working so far and what's going wrong?

  3. atomflame profile image59
    atomflameposted 6 years ago

    Yeah sounds like homework to me.
    Some things you should look at:
    First you should convert the int to a string (char[]). Use itoa.
    Then create an array of 10 items that contains the English word for each number. Good idea would be to match the word to the index of the array. then loop through the number string using each character as the array index. (would have to convert back to int) and concatenate the words together adding a space after each word.

 
working