write a program that takes a three digit/two digit/one digit number as an input and displays the number in words

Member Avatar for iamthwee

Please find attached the solution:

int main()
{
  int number;
  cin>> number;

  cout<<endl;
  cout<<"the number in words";

  return 0;
}

Note: not compiled or tested!

commented: I wish I cold vote more than once on this. +13

You need to start with a skeleton of a program that will compile/run.

Then you need to add the ability prompt for, and read/store a number.

Then, you need to break that number into its component parts.

Then, with those component parts you need to determine what the textual equivalent would be(a premade array with the numbers associated with the index dows nicely here).

After you have determined the textual equivalent, you need to print it and exit.

That is all it would be reasonable for me to offer you as help right now...

HOWEVER: If you write some code, and give it an Honest effort at solving it, and you still have an issue. Then you can come back and post the code, along with a short description of the problem. And I will be more than happy to help you out.

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.