Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8490639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:11:06+00:00 2026-06-10T22:11:06+00:00

Write a program that takes an integer keyed in from the terminal and extracts

  • 0

“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 the following:
nine
three
two
(Remember to display zero if the user types in just 0.)”

Here is my solution. Xcode doesn’t do anything after i type in number. (My mistake is the code is written to show digits in reverse)

Can you help me out? where is the mistake?

#import <Foundation/Foundation.h>
int main (int argc, char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

int number, right_digit;

NSLog (@"Enter your number.");
scanf ("%i", &number);

do {

    right_digit = number % 10;

    switch (right_digit) {

        case '0':
            Nslog (@"zero");
            break;

        case '1':
            NSLog(@"one");
            break;

        case '2':
            NSLog(@"two");
            break;

            case '3':
            NSLog(@"three");
            break;

        case '4':
            NSLog(@"four");
            break;

        case '5':
            NSLog(@"five");
            break;

            case '6':
            NSLog(@ "six");
            break;

            case '7':
            NSLog(@"seven");
            break;

            case '8':
            NSLog(@"eight");
            break;

            case '9':
            NSLog(@"nine");
            break;
        default:
            break;
    }

    number /= 10;

}

while ( number != 0 );



[pool drain];
return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:11:08+00:00Added an answer on June 10, 2026 at 10:11 pm

    The character '0' is different than the number 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The question is to write a program that takes an integer keyed in from
I have to write a program that takes an Integer and converts it into
I am trying to write a Labview program that takes input from a thermal
So im writing c++ program, that takes a integer from input file, multiply it
I'm making a program that takes a three-digit integer and splits it into two
I need to write a program that takes input line at a time and
I'm trying to write a program that takes a large file (of any type)
I'm going to need to write a program that takes a list of persons
I have been assigned wit the task to write a program that takes a
I'm trying to write a simple program that takes in the users input, then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.