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;
}