Hi every one, I am a doctor have a interest in programing ,actually i have been trying to practice on switch statements but i was unable to display numbers like 365 in words
"Three hundred and sixty five", i actually faced problem, all what i was able was to display number 1 to 9 only . I need to display tens, hundreds .
If any one has an idea please help;
i love c++, language
#include<iostream>
using namespace std;
int main()
{
int a;
nxt: cout<<"\n Please enter a number(99 to stop)..";
cin>>a;
if(a==99) goto xt;
switch (a)
{
case 1: cout<<"One\n";
break;
case 2: cout<<"Two\n";
break;
case 3: cout<<"Three\n";
break;
case 4: cout<<"four\n";
case 5: cout<<"five\n";
case 6: cout<<"six\n";
case 7: cout<<"seven\n";
case8: cout<<"eight\n";
case 9: cout<<"nine\n";
}
goto nxt;
xt:
;
return 0;
}