Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   C (https://www.askmehelpdesk.com/forumdisplay.php?f=438)
-   -   C programing tackle (https://www.askmehelpdesk.com/showthread.php?t=90734)

  • May 9, 2007, 03:26 AM
    muziti
    c programing tackle
    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
  • May 10, 2007, 01:53 PM
    Nosnosna
    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.
  • May 10, 2007, 02:29 PM
    muziti
    Quote:

    Originally Posted by Nosnosna
    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.
  • Mar 19, 2008, 03:12 PM
    vikash kumar
    /* 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 );
    }

  • All times are GMT -7. The time now is 06:40 AM.