473,486 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to approach to the following program

8 New Member
How to give output in words for the input given in numbers?
For example:
1234
one thousand two hundred and thirty four
May 12 '10 #1
2 1345
whodgson
542 Contributor
Start by writing your program so that it simply substitutes "one" for 1 and "two" for 2 so that in your case it will output one two three four. Then improve the code to produce "thirty four" instead of "three four". You will need to take care of "eleven" to "nineteen" with the tens and ones digits and then extend this out for use with "fourteen" billion, million, thousand and hundred.
hth`s
May 12 '10 #2
donbock
2,426 Recognized Expert Top Contributor
Look here.
May 12 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
1369
by: devesh.agrawal | last post by:
Hi , this program does a segfault in g++3.2 onwards , works with g++2.95 , Any ideas are welcome , basically there is this instruction when compiled with -S option , call *%eax , where the one...
4
1528
by: PengYu.UT | last post by:
Hi, It seems that the line with "//no error" and "//error" are the same. However, the second one give an error. I'm using g++-3.3. The error message was: g++-3.3 -g -c -o main.o main.cc...
1
1544
by: PengYu.UT | last post by:
I forward declared the class test. But I still get some error. Would you please help me to find out what is wrong with this program? Peng //#include <utility> #include <iostream> //using...
6
1808
by: PengYu.UT | last post by:
Hi, I run into error with the following program. Would you please help me? Best wishes, Peng struct tag1{}; struct tag2{};
2
2049
by: mikelinyoho | last post by:
Does the following program architecture make sense? #include <stdio.h> #include "test1.c" #include "sample.cpp" int main(void){ output();
6
1483
by: AndyL | last post by:
Hi, What would by a python equivalent of following shell program: #!/bin/sh prog1 > file1 & prog2 > file2 &
10
2322
by: sunny | last post by:
Does this following program implement the factory design.if not what are things that i have to change in order to make this following program to be designed to factory design pattern. ...
0
7094
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5427
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.