--- s b <[EMAIL PROTECTED]> wrote:

> i know that but how would i be able 2 do it i mean,
> like wat conditions i use can i get some examples
> 

Below is a small code sample that demonstrates number
to words.

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    
    int Some_Number = 123;
    int Digit;
    char Words[5][25];
    int count = 0;

    while(Some_Number)
    {
      Digit = Some_Number % 10;
      
      switch (Digit)
      {
        case 1 :      
        {
         strcpy(Words[count], "ONE");
         break;
        }
        case 2 :
        {     
         strcpy(Words[count], "TWO");
         break;
        } 
        case 3 :
        {     
         strcpy(Words[count], "THREE");
         break;
        }
        
        // Handle case to 9 and also case zero
         
      }
      
      Some_Number = Some_Number / 10; 
      ++count;
    }
    
    // now print the words that are in the array
    
    for (Digit = count-1; Digit >= 0; --Digit)
    {
       cout << Words[Digit] << " "; 
    }    
    cout << endl; 
    
    system("PAUSE");
    return EXIT_SUCCESS;
}


Mickey M.
Construction Partner Inc.
http://www.constructionpartner.com


       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
http://farechase.yahoo.com/

Reply via email to