#include
#include
using namespace std;
int main()
{
int num;
int temp, temp2, temp3;
int length;
int check;
int rem1, rem2, rem3, rem4, rem5, rem6, rem7, rem8, th_rem, lac_rem;
cout << "_________________________________________________________________" << endl;
cout << "----------------------Number to Words Converter------------------" << endl;
cout << "_________________________________________________________________" << endl;
cout << "Enter the number:" << endl;
cout << "Number length should be less than equal to 7 digits :" << endl;
cin >> num;
// get length of a number
length = log10(num) + 1;
temp = num;
temp2 = num;
check=num;
temp3 = num;
// Get all reminders
rem6 = num % 10;
num = num / 10;
rem5 = num % 10;
num = num / 10;
rem4 = num % 10;
num = num / 10;
rem3 = num % 10;
num = num / 10;
rem2 = num % 10;
num = num / 10;
rem1 = num % 10;
num = num / 10;
rem8 = num % 10;
// get last two digits
rem7 = temp % 100;
temp2 = temp2 % 100000;
th_rem = temp2 / 1000;
temp3 = temp3 % 10000000;
lac_rem = temp3 / 100000;
// check for the less tha n six digits
if (check< 9999999)
{
if (length == 1)
{
switch (rem6)
{
case 0:
{
cout << "zero";
break;
}
case 1:
{
cout << "one";
break;
}
case 2:
{
cout << "two";
break;
}
case 3:
{
cout << "three";
break;
}
case 4:
{
cout << "four";
break;
}
case 5:
{
cout << "five";
break;
}
case 6:
{
cout << "six";
break;
}
case 7:
{
cout << "seven";
break;
}
case 8:
{
cout << "eight";
break;
}
case 9:
{
cout << "nine";
break;
}
}
}
else if (length == 2)
{
if (rem7 < 20 && rem7 >= 10)
{
switch (rem6)
{
case 0:
{
cout << "ten";
break;
}
case 1:
{
cout << "eleven";
break;
}
case 2:
{
cout << "twelve";
break;
}
case 3:
{
cout << "thirteen";
break;
}
case 4:
{
cout << "fourteen";
break;
}
case 5:
{
cout << "fifteen";
break;
}
case 6:
{
cout << "sixteen";
break;
}
case 7:
{
cout << "seventeen";
break;
}
case 8:
{
cout << "eighteen";
break;
}
case 9:
{
cout << "nineteen";
break;
}
}
}
else
{
switch (rem5)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "ten ";
break;
}
case 2:
{
cout << "twenty ";
break;
}
case 3:
{
cout << "thirty ";
break;
}
case 4:
{
cout << "fourty ";
break;
}
case 5:
{
cout << "fifty ";
break;
}
case 6:
{
cout << "sixty ";
break;
}
case 7:
{
cout << "seventy ";
break;
}
case 8:
{
cout << "eighty ";
break;
}
case 9:
{
cout << "ninty ";
break;
}
}
switch (rem6)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "one";
break;
}
case 2:
{
cout << "two";
break;
}
case 3:
{
cout << "three";
break;
}
case 4:
{
cout << "four";
break;
}
case 5:
{
cout << "five";
break;
}
case 6:
{
cout << "six";
break;
}
case 7:
{
cout << "seven";
break;
}
case 8:
{
cout << "eight";
break;
}
case 9:
{
cout << "nine";
break;
}
}
}
}
else if (length == 3)
{
switch (rem4)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << " One hundred ";
break;
}
case 2:
{
cout << "Two hundred ";
break;
}
case 3:
{
cout << "Three hundred ";
break;
}
case 4:
{
cout << "Four hundred ";
break;
}
case 5:
{
cout << "Five hundred ";
break;
}
case 6:
{
cout << "Six hundred ";
break;
}
case 7:
{
cout << "Seven hundred ";
break;
}
case 8:
{
cout << "Eight hundred ";
break;
}
case 9:
{
cout << "Nine hundred ";
}
}
if (rem7 < 20 && rem7 >= 10)
{
switch (rem6)
{
case 0:
{
cout << "ten";
break;
}
case 1:
{
cout << "eleven";
break;
}
case 2:
{
cout << "twelve";
break;
}
case 3:
{
cout << "thirteen";
break;
}
case 4:
{
cout << "fourteen";
break;
}
case 5:
{
cout << "fifteen";
break;
}
case 6:
{
cout << "sixteen";
break;
}
case 7:
{
cout << "seventeen";
break;
}
case 8:
{
cout << "eighteen";
break;
}
case 9:
{
cout << "nineteen";
break;
}
}
}
else
{
switch (rem5)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "ten ";
break;
}
case 2:
{
cout << "twenty ";
break;
}
case 3:
{
cout << "thirty ";
break;
}
case 4:
{
cout << "fourty ";
break;
}
case 5:
{
cout << "fifty ";
break;
}
case 6:
{
cout << "sixty ";
break;
}
case 7:
{
cout << "seventy ";
break;
}
case 8:
{
cout << "eighty ";
break;
}
case 9:
{
cout << "ninty ";
break;
}
}
switch (rem6)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "one";
break;
}
case 2:
{
cout << "two";
break;
}
case 3:
{
cout << "three";
break;
}
case 4:
{
cout << "four";
break;
}
case 5:
{
cout << "five";
break;
}
case 6:
{
cout << "six";
break;
}
case 7:
{
cout << "seven";
break;
}
case 8:
{
cout << "eight";
break;
}
case 9:
{
cout << "nine";
break;
}
}
}
}
else if (length == 4)
{
switch (rem3)
{
case 0:
{
cout << " ";
}
case 1:
{
cout << "One thousand ";
break;
}
case 2:
{
cout << "Two thousand ";
break;
}
case 3:
{
cout << "Three thousand ";
break;
}
case 4:
{
cout << "Four thousand ";
break;
}
case 5:
{
cout << "Five thousand ";
break;
}
case 6:
{
cout << "Six thousand ";
break;
}
case 7:
{
cout << "Seven thousand ";
break;
}
case 8:
{
cout << "Eight thousand ";
break;
}
case 9:
{
cout << "Nine thousand ";
break;
}
}
switch (rem4)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << " One hundred ";
break;
}
case 2:
{
cout << "Two hundred ";
break;
}
case 3:
{
cout << "Three hundred ";
break;
}
case 4:
{
cout << "Four hundred ";
break;
}
case 5:
{
cout << "Five hundred ";
break;
}
case 6:
{
cout << "Six hundred ";
break;
}
case 7:
{
cout << "Seven hundred ";
break;
}
case 8:
{
cout << "Eight hundred ";
break;
}
case 9:
{
cout << "Nine hundred ";
}
}
if (rem7 < 20 && rem7 >= 10)
{
switch (rem6)
{
case 0:
{
cout << "ten";
break;
}
case 1:
{
cout << "eleven";
break;
}
case 2:
{
cout << "twelve";
break;
}
case 3:
{
cout << "thirteen";
break;
}
case 4:
{
cout << "fourteen";
break;
}
case 5:
{
cout << "fifteen";
break;
}
case 6:
{
cout << "sixteen";
break;
}
case 7:
{
cout << "seventeen";
break;
}
case 8:
{
cout << "eighteen";
break;
}
case 9:
{
cout << "nineteen";
break;
}
}
}
else
{
switch (rem5)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "ten ";
break;
}
case 2:
{
cout << "twenty ";
break;
}
case 3:
{
cout << "thirty ";
break;
}
case 4:
{
cout << "fourty ";
break;
}
case 5:
{
cout << "fifty ";
break;
}
case 6:
{
cout << "sixty ";
break;
}
case 7:
{
cout << "seventy ";
break;
}
case 8:
{
cout << "eighty ";
break;
}
case 9:
{
cout << "ninty ";
break;
}
}
switch (rem6)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "one";
break;
}
case 2:
{
cout << "two";
break;
}
case 3:
{
cout << "three";
break;
}
case 4:
{
cout << "four";
break;
}
case 5:
{
cout << "five";
break;
}
case 6:
{
cout << "six";
break;
}
case 7:
{
cout << "seven";
break;
}
case 8:
{
cout << "eight";
break;
}
case 9:
{
cout << "nine";
break;
}
}
}
}
else if (length == 5)
{
if (rem3 == 0)
{
switch (rem2)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "Ten thousand ";
break;
}
case 2:
{
cout << "Twenty thousand ";
break;
}
case 3:
{
cout << "Thirty thousand ";
break;
}
case 4:
{
cout << "Fourty thousand ";
break;
}
case 5:
{
cout << "Fifty thousand ";
break;
}
case 6:
{
cout << "Sixty thousand ";
break;
}
case 7:
{
cout << "Seventy thousand ";
break;
}
case 8:
{
cout << "Eighty thousand ";
break;
}
case 9:
{
cout << "Ninty thousand ";
break;
}
}
}
else
{
if (th_rem > 10 && th_rem < 20)
{
switch (rem3)
{
case 1:
{
cout << "eleven thousand ";
break;
}
case 2:
{
cout << "twelve thousand ";
break;
}
case 3:
{
cout << "thirteen thousand ";
break;
}
case 4:
{
cout << "fourteen thousand ";
break;
}
case 5:
{
cout << "fifteen thousand ";
break;
}
case 6:
{
cout << "sixteen thousand ";
break;
}
case 7:
{
cout << "seventeen thousand ";
break;
}
case 8:
{
cout << "eighteen thousand ";
break;
}
case 9:
{
cout << "nineteen thousand ";
break;
}
}
}
else
{
switch (rem2)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "Ten ";
break;
}
case 2:
{
cout << "Twenty ";
break;
}
case 3:
{
cout << "Thirty ";
break;
}
case 4:
{
cout << "Fourty ";
break;
}
case 5:
{
cout << "Fifty ";
break;
}
case 6:
{
cout << "Sixty ";
break;
}
case 7:
{
cout << "Seventy ";
break;
}
case 8:
{
cout << "Eighty ";
break;
}
case 9:
{
cout << "Ninty ";
break;
}
}
switch (rem3)
{
case 1:
{
cout << "One thousand ";
break;
}
case 2:
{
cout << "Two thousand ";
break;
}
case 3:
{
cout << "Three thousand ";
break;
}
case 4:
{
cout << "Four thousand ";
break;
}
case 5:
{
cout << "Five thousand ";
break;
}
case 6:
{
cout << "Six thousand ";
break;
}
case 7:
{
cout << "Seven thousand ";
break;
}
case 8:
{
cout << "Eight thousand ";
break;
}
case 9:
{
cout << "Nine thousand ";
break;
}
}
}
}
switch (rem4)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << " One hundred ";
break;
}
case 2:
{
cout << "Two hundred ";
break;
}
case 3:
{
cout << "Three hundred ";
break;
}
case 4:
{
cout << "Four hundred ";
break;
}
case 5:
{
cout << "Five hundred ";
break;
}
case 6:
{
cout << "Six hundred ";
break;
}
case 7:
{
cout << "Seven hundred ";
break;
}
case 8:
{
cout << "Eight hundred ";
break;
}
case 9:
{
cout << "Nine hundred ";
}
}
if (rem7 < 20 && rem7 >= 10)
{
switch (rem6)
{
case 0:
{
cout << "ten";
break;
}
case 1:
{
cout << "eleven ";
break;
}
case 2:
{
cout << "twelve ";
break;
}
case 3:
{
cout << "thirteen ";
break;
}
case 4:
{
cout << "fourteen ";
break;
}
case 5:
{
cout << "fifteen ";
break;
}
case 6:
{
cout << "sixteen ";
break;
}
case 7:
{
cout << "seventeen ";
break;
}
case 8:
{
cout << "eighteen ";
break;
}
case 9:
{
cout << "nineteen ";
break;
}
}
}
else
{
switch (rem5)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "ten ";
break;
}
case 2:
{
cout << "twenty ";
break;
}
case 3:
{
cout << "thirty ";
break;
}
case 4:
{
cout << "fourty ";
break;
}
case 5:
{
cout << "fifty ";
break;
}
case 6:
{
cout << "sixty ";
break;
}
case 7:
{
cout << "seventy ";
break;
}
case 8:
{
cout << "eighty ";
break;
}
case 9:
{
cout << "ninty ";
break;
}
}
switch (rem6)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "one";
break;
}
case 2:
{
cout << "two";
break;
}
case 3:
{
cout << "three";
break;
}
case 4:
{
cout << "four";
break;
}
case 5:
{
cout << "five";
break;
}
case 6:
{
cout << "six";
break;
}
case 7:
{
cout << "seven";
break;
}
case 8:
{
cout << "eight";
break;
}
case 9:
{
cout << "nine";
break;
}
}
}
}
else if (length == 6)
{
switch (rem1)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "One lac ";
break;
}
case 2:
{
cout << "Two lac ";
break;
}
case 3:
{
cout << "Three lac ";
}
case 4:
{
cout << "Four lac ";
break;
}
case 5:
{
cout << "Five lac ";
break;
}
case 6:
{
cout << "Six lac ";
break;
}
case 7:
{
cout << "Seven lac ";
break;
}
case 8:
{
cout << "Eight lac ";
break;
}
case 9:
{
cout << "Nine lac ";
break;
}
}
if (rem3 == 0)
{
switch (rem2)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "Ten thousand ";
break;
}
case 2:
{
cout << "Twenty thousand ";
break;
}
case 3:
{
cout << "Thirty thousand ";
break;
}
case 4:
{
cout << "Fourty thousand ";
break;
}
case 5:
{
cout << "Fifty thousand ";
break;
}
case 6:
{
cout << "Sixty thousand ";
break;
}
case 7:
{
cout << "Seventy thousand ";
break;
}
case 8:
{
cout << "Eighty thousand ";
break;
}
case 9:
{
cout << "Ninty thousand ";
break;
}
}
}
else
{
if (th_rem > 10 && th_rem < 20)
{
switch (rem3)
{
case 1:
{
cout << "eleven thousand ";
break;
}
case 2:
{
cout << "twelve thousand ";
break;
}
case 3:
{
cout << "thirteen thousand ";
break;
}
case 4:
{
cout << "fourteen thousand ";
break;
}
case 5:
{
cout << "fifteen thousand ";
break;
}
case 6:
{
cout << "sixteen thousand ";
break;
}
case 7:
{
cout << "seventeen thousand ";
break;
}
case 8:
{
cout << "eighteen thousand ";
break;
}
case 9:
{
cout << "nineteen thousand ";
break;
}
}
}
else
{
switch (rem2)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "Ten ";
break;
}
case 2:
{
cout << "Twenty ";
break;
}
case 3:
{
cout << "Thirty ";
break;
}
case 4:
{
cout << "Fourty ";
break;
}
case 5:
{
cout << "Fifty ";
break;
}
case 6:
{
cout << "Sixty ";
break;
}
case 7:
{
cout << "Seventy ";
break;
}
case 8:
{
cout << "Eighty ";
break;
}
case 9:
{
cout << "Ninty ";
break;
}
}
switch (rem3)
{
case 1:
{
cout << "One thousand ";
break;
}
case 2:
{
cout << "Two thousand ";
break;
}
case 3:
{
cout << "Three thousand ";
break;
}
case 4:
{
cout << "Four thousand ";
break;
}
case 5:
{
cout << "Five thousand ";
break;
}
case 6:
{
cout << "Six thousand ";
break;
}
case 7:
{
cout << "Seven thousand ";
break;
}
case 8:
{
cout << "Eight thousand ";
break;
}
case 9:
{
cout << "Nine thousand ";
break;
}
}
}
}
switch (rem4)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << " One hundred ";
break;
}
case 2:
{
cout << "Two hundred ";
break;
}
case 3:
{
cout << "Three hundred ";
break;
}
case 4:
{
cout << "Four hundred ";
break;
}
case 5:
{
cout << "Five hundred ";
break;
}
case 6:
{
cout << "Six hundred ";
break;
}
case 7:
{
cout << "Seven hundred ";
break;
}
case 8:
{
cout << "Eight hundred ";
break;
}
case 9:
{
cout << "Nine hundred ";
}
}
if (rem7 < 20 && rem7 >= 10)
{
switch (rem6)
{
case 0:
{
cout << "ten";
break;
}
case 1:
{
cout << "eleven ";
break;
}
case 2:
{
cout << "twelve ";
break;
}
case 3:
{
cout << "thirteen ";
break;
}
case 4:
{
cout << "fourteen ";
break;
}
case 5:
{
cout << "fifteen ";
break;
}
case 6:
{
cout << "sixteen ";
break;
}
case 7:
{
cout << "seventeen ";
break;
}
case 8:
{
cout << "eighteen ";
break;
}
case 9:
{
cout << "nineteen ";
break;
}
}
}
else
{
switch (rem5)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "ten ";
break;
}
case 2:
{
cout << "twenty ";
break;
}
case 3:
{
cout << "thirty ";
break;
}
case 4:
{
cout << "fourty ";
break;
}
case 5:
{
cout << "fifty ";
break;
}
case 6:
{
cout << "sixty ";
break;
}
case 7:
{
cout << "seventy ";
break;
}
case 8:
{
cout << "eighty ";
break;
}
case 9:
{
cout << "ninty ";
break;
}
}
switch (rem6)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "one";
break;
}
case 2:
{
cout << "two";
break;
}
case 3:
{
cout << "three";
break;
}
case 4:
{
cout << "four";
break;
}
case 5:
{
cout << "five";
break;
}
case 6:
{
cout << "six";
break;
}
case 7:
{
cout << "seven";
break;
}
case 8:
{
cout << "eight";
break;
}
case 9:
{
cout << "nine";
break;
}
}
}
}
else if (length == 7)
{
if (rem1 == 0)
{
switch (rem8)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "Ten Lac ";
break;
}
case 2:
{
cout << "Twenty lac ";
break;
}
case 3:
{
cout << "Thirty lac ";
break;
}
case 4:
{
cout << "Fourty lac ";
break;
}
case 5:
{
cout << "Fifty lac ";
break;
}
case 6:
{
cout << "Sixty lac ";
break;
}
case 7:
{
cout << "Seventy lac ";
break;
}
case 8:
{
cout << "Eighty lac ";
break;
}
case 9:
{
cout << "Ninty lac ";
break;
}
}
}
else if (rem1 != 0)
{
if (lac_rem > 10)
{
if (lac_rem < 20)
{
switch (rem1)
{
case 1:
{
cout << "eleven lac ";
break;
}
case 2:
{
cout << "twelve lac ";
break;
}
case 3:
{
cout << "thirteen lac ";
break;
}
case 4:
{
cout << "fourteen lac ";
break;
}
case 5:
{
cout << "fifteen lac ";
break;
}
case 6:
{
cout << "sixteen lac ";
break;
}
case 7:
{
cout << "seventeen lac ";
break;
}
case 8:
{
cout << "eighteen lac ";
break;
}
case 9:
{
cout << "nineteen lac ";
break;
}
}
}
}
if (rem8 != 1)
{
switch (rem8)
{
case 2:
{
cout << "twenty ";
break;
}
case 3:
{
cout << "thirty ";
break;
}
case 4:
{
cout << "fourty ";
break;
}
case 5:
{
cout << "fifty ";
break;
}
case 6:
{
cout << "sixty ";
break;
}
case 7:
{
cout << "seventy ";
break;
}
case 8:
{
cout << "eighty ";
break;
}
case 9:
{
cout << "ninty ";
break;
}
}
switch (rem1)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "One lac ";
break;
}
case 2:
{
cout << "Two lac ";
break;
}
case 3:
{
cout << "Three lac ";
break;
}
case 4:
{
cout << "Four lac ";
break;
}
case 5:
{
cout << "Five lac ";
break;
}
case 6:
{
cout << "Six lac ";
break;
}
case 7:
{
cout << "Seven lac ";
break;
}
case 8:
{
cout << "Eight lac ";
break;
}
case 9:
{
cout << "Nine lac ";
break;
}
}
}
}
if (rem3 == 0)
{
switch (rem2)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "Ten thousand ";
break;
}
case 2:
{
cout << "Twenty thousand ";
break;
}
case 3:
{
cout << "Thirty thousand ";
break;
}
case 4:
{
cout << "Fourty thousand ";
break;
}
case 5:
{
cout << "Fifty thousand ";
break;
}
case 6:
{
cout << "Sixty thousand ";
break;
}
case 7:
{
cout << "Seventy thousand ";
break;
}
case 8:
{
cout << "Eighty thousand ";
break;
}
case 9:
{
cout << "Ninty thousand ";
break;
}
}
}
else
{
if (th_rem > 10 && th_rem < 20)
{
switch (rem3)
{
case 1:
{
cout << "eleven thousand ";
break;
}
case 2:
{
cout << "twelve thousand ";
break;
}
case 3:
{
cout << "thirteen thousand ";
break;
}
case 4:
{
cout << "fourteen thousand ";
break;
}
case 5:
{
cout << "fifteen thousand ";
break;
}
case 6:
{
cout << "sixteen thousand ";
break;
}
case 7:
{
cout << "seventeen thousand ";
break;
}
case 8:
{
cout << "eighteen thousand ";
break;
}
case 9:
{
cout << "nineteen thousand ";
break;
}
}
}
else
{
switch (rem2)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "Ten ";
break;
}
case 2:
{
cout << "Twenty ";
break;
}
case 3:
{
cout << "Thirty ";
break;
}
case 4:
{
cout << "Fourty ";
break;
}
case 5:
{
cout << "Fifty ";
break;
}
case 6:
{
cout << "Sixty ";
break;
}
case 7:
{
cout << "Seventy ";
break;
}
case 8:
{
cout << "Eighty ";
break;
}
case 9:
{
cout << "Ninty ";
break;
}
}
switch (rem3)
{
case 1:
{
cout << "One thousand ";
break;
}
case 2:
{
cout << "Two thousand ";
break;
}
case 3:
{
cout << "Three thousand ";
break;
}
case 4:
{
cout << "Four thousand ";
break;
}
case 5:
{
cout << "Five thousand ";
break;
}
case 6:
{
cout << "Six thousand ";
break;
}
case 7:
{
cout << "Seven thousand ";
break;
}
case 8:
{
cout << "Eight thousand ";
break;
}
case 9:
{
cout << "Nine thousand ";
break;
}
}
}
}
switch (rem4)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << " One hundred ";
break;
}
case 2:
{
cout << "Two hundred ";
break;
}
case 3:
{
cout << "Three hundred ";
break;
}
case 4:
{
cout << "Four hundred ";
break;
}
case 5:
{
cout << "Five hundred ";
break;
}
case 6:
{
cout << "Six hundred ";
break;
}
case 7:
{
cout << "Seven hundred ";
break;
}
case 8:
{
cout << "Eight hundred ";
break;
}
case 9:
{
cout << "Nine hundred ";
}
}
if (rem7 < 20 && rem7 >= 10)
{
switch (rem6)
{
case 0:
{
cout << "ten";
break;
}
case 1:
{
cout << "eleven ";
break;
}
case 2:
{
cout << "twelve ";
break;
}
case 3:
{
cout << "thirteen ";
break;
}
case 4:
{
cout << "fourteen ";
break;
}
case 5:
{
cout << "fifteen ";
break;
}
case 6:
{
cout << "sixteen ";
break;
}
case 7:
{
cout << "seventeen ";
break;
}
case 8:
{
cout << "eighteen ";
break;
}
case 9:
{
cout << "nineteen ";
break;
}
}
}
else
{
switch (rem5)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "ten ";
break;
}
case 2:
{
cout << "twenty ";
break;
}
case 3:
{
cout << "thirty ";
break;
}
case 4:
{
cout << "fourty ";
break;
}
case 5:
{
cout << "fifty ";
break;
}
case 6:
{
cout << "sixty ";
break;
}
case 7:
{
cout << "seventy ";
break;
}
case 8:
{
cout << "eighty ";
break;
}
case 9:
{
cout << "ninty ";
break;
}
}
switch (rem6)
{
case 0:
{
cout << " ";
break;
}
case 1:
{
cout << "one";
break;
}
case 2:
{
cout << "two";
break;
}
case 3:
{
cout << "three";
break;
}
case 4:
{
cout << "four";
break;
}
case 5:
{
cout << "five";
break;
}
case 6:
{
cout << "six";
break;
}
case 7:
{
cout << "seven";
break;
}
case 8:
{
cout << "eight";
break;
}
case 9:
{
cout << "nine";
break;
}
}
}
}
}
else
{
cout << " Invalid:Input!Number should be less than equal to 7 digits " << endl;
}
return 0;
}
If you don't find any problem,in this website and if you have a very difficult assignment question that is not present on internet ,then you dont bother yourself,we are here to solve every problem of your life you just click on the Problem asking button and write your problem we slove the code of your problem and sent you on your email addres that you put in the sin up form.