View Full Version : C programing tackle
muziti
May 9, 2007, 03:26 AM
hello all
I was thinking of a program that converts the integer you entered into
english alphabet
for example if a user types 1234
then the out put should be one two three four;
but the number of digits to be entered should not be fixed any digit integer
if you solve this problem send a message to my mail address
[email protected].
thank you all
with all the best
Nosnosna
May 10, 2007, 01:53 PM
This is a simple program to create:
First, convert the input integer to a string (or take the input as a string instead of an integer)
Iterate through the characters in the string, and for each one, replace it with the english equivalent, using whatever control structure you prefer. The only limit to the number of digits you can do in this method is the maximum length of a string, which is unlikely to be a problem.
muziti
May 10, 2007, 02:29 PM
This is a simple program to create:
First, convert the input integer to a string (or take the input as a string instead of an integer)
"Iterate "through the characters in the string, and for each one, replace it with the english equivalent, using whatever control structure you prefer. The only limit to the number of digits you can do in this method is the maximum length of a string, which is unlikely to be a problem.
Can u show me the steps to do this and send it to my mail.
Thank you.
vikash kumar
Mar 19, 2008, 03:12 PM
/* convert a string to an integer */
#include <stdio.h>
#include <stdlib.h>
char string[] = "1234";
main()
{
int sum;
sum = atoi( string );
printf("Sum = %d\n", sum );
}