My original question stated:

1. Write a function named "digits" that takes an integer argument in the range from 1 to 9 , inclusive, and prints the English name for that integer on the computer screen. No newline character should be sent to the screen following the digit name. The function should not return a value. The cursor should remain on the same line as the name that has been printed. If the argument is not in the required range, then the function should print "digit error" without the quotation marks but followed by the newline character. Thus, for example, the statement digit_name(7); should print seven on the screen; the statement digit_name(0); should print digit error on the screen and place the cursor at the beginning of the next line.

I seen this post:

but not sure why i was asked to do so if its not possible?

#include <cstdio>
#include <cstdlib>
#include <iostream>

using namespace std;

void digits(void)
    int i;
	int nvalue;
	cout << "Enter a Number 1 thru 9: ";

    for(i=0; i<10; i++)

    cin >> nvalue;

            case 1:
            cout << "one";

            case 2:
            cout << "two";

            case 3:
            cout << "three";

            case 4:
            cout << "four";

            case 5:
            cout << "five";

            case 6:
            cout << "six";

            case 7:
            cout << "seven";

            case 8:
            cout << "eight";

            case 9:
            cout << "nine";


            cout << "digit error\n";

int main(int nNumberofArgs, char* pszArgs[])


    return 0;

This is a different matter entirely. The question you linked to was specifically about not printing a line break after hitting the Enter/Return key. Your requirement is merely not to print a newline character, which you're already doing.

Thanks Narue I've been having troulbe breaking down the questions as I read I start trying to plan an attack on the problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.