Thread: C++ program help(converting numbers to english words)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    1

    Question C++ program help

    I need to write a simple algorithm for converting numbers into english words. The numbers cannot be below -2,000,000,000 or above 2,000,000,000. If anyone can help it would certainly help me a lot.

    Here is what I have so far.
    #include <iostream>
    using namespace std;
    int main ()
    {
    int num;
    cout<<"Enter an integer (or zero to exit)";
    cin>>num;
    while ((num>-2,147,483,647)&&(num<2,147,483,647)){
    if (num>1,000,000,000){
    cout<<num/1,000,000,000;}
    if (num>1,000,000){
    cout<<num/1,000,000;}
    if (num>1,000){
    cout<<num/1,000;}
    if (num>100){
    cout<<num/100;}
    }
    return 0;
    }
    Last edited by bama1; 10-07-2002 at 07:49 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 02-19-2009, 07:19 PM
  2. Replies: 5
    Last Post: 12-21-2007, 01:38 PM
  3. Destinguish between numbers and words
    By Suchy in forum C++ Programming
    Replies: 3
    Last Post: 10-09-2007, 12:48 PM
  4. count words program problem
    By Tony654321 in forum C Programming
    Replies: 8
    Last Post: 10-19-2004, 11:23 AM