Thread: Need help

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    5
    Rep Power
    0

    Need help


    Writd a prog. to input any no. & find d combinations of the digits.
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,392
    Rep Power
    1871
    Read THIS FIRST before making demands for other people to do your homework.

    Our "help" is in direct proportion to your "effort".
    The more you put in, the more likely we are to help you.

    Since your effort is zero - well, I guess you know what the answer is.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,896
    Rep Power
    481
    I just looked at all threads started by you.
    Programming is not your strength.
    Find a different career. Sorry.

    By the way, it doesn't seem to be the right career for me since I'm jobless but have been programming since 1975.

    Comments on this post

    • ptr2void agrees : I just want to say this so damn often! Bravo!
    [code]Code tags[/code] are essential for python code and Makefiles!
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    I'm in a charitable mood tonight, so here you go:
    Code:
    #include <stdio.h>
    
    typedef struct {
        int ch;
        int count;
    } star_t;
    
    int main(void) {
        star_t foo[] = {
    {32, 4}, {95, 8}, {32, 3}, {95, 2}, {32, 4}, {95, 2}, {32, 4}, {95, 7}, {32, 3}, {95, 2}, {32, 4}, {95, 2}, {'\n', 1}, 
    {32, 3}, {124, 1}, {9, 1}, {32, 4}, {124, 1}, {32, 1}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {47, 1}, {9, 1}, {32, 2}, {124, 1}, {32, 1}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {47, 1}, {32, 2}, {47, 1}, {'\n', 1}, 
    {32, 3}, {124, 1}, {32, 2}, {45, 6}, {39, 1}, {32, 1}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 3}, {95, 4}, {124, 1}, {32, 1}, {124, 1}, {32, 2}, {124, 1}, {32, 1}, {47, 1}, {32, 2}, {47, 1}, {'\n', 1}, 
    {32, 3}, {124, 1}, {32, 2}, {124, 1}, {95, 3}, {32, 4}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {9, 1}, {32, 4}, {124, 1}, {32, 2}, {124, 1}, {47, 1}, {32, 2}, {47, 1}, {'\n', 1}, 
    {32, 3}, {124, 1}, {32, 3}, {95, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {9, 1}, {32, 4}, {124, 1}, {9, 1}, {32, 2}, {47, 1}, {'\n', 1}, 
    {32, 3}, {124, 1}, {32, 2}, {124, 1}, {32, 7}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {32, 2}, {124, 1}, {95, 4}, {32, 2}, {124, 1}, {9, 1}, {32, 2}, {92, 1}, {'\n', 1}, 
    {32, 3}, {124, 1}, {32, 2}, {124, 1}, {32, 7}, {124, 1}, {32, 3}, {45, 2}, {32, 3}, {124, 1}, {32, 2}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {32, 1}, {124, 1}, {32, 2}, {124, 1}, {92, 1}, {32, 2}, {92, 1}, {'\n', 1}, 
    {32, 3}, {124, 1}, {95, 2}, {124, 1}, {32, 7}, {92, 1}, {95, 8}, {47, 1}, {32, 3}, {92, 1}, {95, 6}, {124, 1}, {32, 1}, {124, 1}, {95, 2}, {124, 1}, {32, 1}, {92, 1}, {95, 2}, {92, 1}, {'\n', 1}, 
    {'\n', 1}, 
    {9, 4}, {32, 5}, {95, 5}, {'\n', 1}, 
    {9, 4}, {32, 4}, {124, 2}, {9, 1}, {32, 1}, {124, 2}, {'\n', 1}, 
    {9, 4}, {32, 4}, {124, 1}, {92, 1}, {95, 3}, {47, 1}, {124, 1}, {'\n', 1}, 
    {9, 4}, {32, 4}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 4}, {32, 4}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 4}, {32, 4}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 4}, {32, 4}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 4}, {32, 4}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 4}, {32, 4}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 3}, {32, 7}, {95, 5}, {124, 1}, {60, 1}, {45, 3}, {62, 1}, {124, 1}, {95, 5}, {'\n', 1}, 
    {9, 3}, {32, 6}, {47, 1}, {32, 5}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {9, 1}, {92, 1}, {'\n', 1}, 
    {9, 3}, {32, 1}, {47, 1}, {32, 4}, {124, 1}, {32, 5}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {9, 1}, {124, 1}, {32, 1}, {92, 1}, {'\n', 1}, 
    {9, 3}, {32, 1}, {124, 1}, {32, 4}, {124, 1}, {32, 5}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {9, 1}, {124, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 3}, {32, 1}, {124, 1}, {32, 4}, {124, 1}, {32, 5}, {124, 1}, {9, 1}, {32, 2}, {124, 1}, {9, 1}, {124, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 3}, {32, 1}, {124, 1}, {9, 3}, {124, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 3}, {32, 1}, {124, 1}, {9, 3}, {124, 1}, {32, 2}, {124, 1}, {'\n', 1}, 
    {9, 3}, {32, 1}, {124, 1}, {9, 3}, {32, 2}, {47, 1}, {'\n', 1}, 
    {9, 3}, {32, 1}, {124, 1}, {9, 3}, {32, 1}, {47, 1}, {'\n', 1}, 
    {9, 3}, {32, 2}, {92, 1}, {9, 2}, {32, 7}, {47, 1}, {'\n', 1}, 
    {9, 3}, {32, 3}, {92, 1}, {9, 2}, {32, 6}, {47, 1}, {'\n', 1}, 
    {9, 3}, {32, 4}, {124, 1}, {9, 2}, {32, 6}, {124, 1}, {'\n', 1}, 
    {9, 3}, {32, 4}, {124, 1}, {9, 2}, {32, 6}, {124, 1}, {'\n', 1}, 
    {'\n', 1}, 
    {9, 4}, {32, 5}, {95, 4}, {32, 5}, {95, 4}, {32, 2}, {95, 9}, {9, 1}, {95, 3}, {9, 1}, {95, 3}, {'\n', 1}, 
    {9, 4}, {32, 5}, {92, 1}, {9, 1}, {32, 1}, {92, 1}, {32, 3}, {47, 1}, {9, 1}, {32, 1}, {47, 1}, {32, 1}, {47, 1}, {9, 1}, {32, 5}, {92, 1}, {32, 1}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {'\n', 1}, 
    {9, 4}, {32, 6}, {92, 1}, {32, 3}, {92, 1}, {32, 1}, {47, 1}, {9, 1}, {47, 1}, {32, 2}, {124, 1}, {32, 2}, {95, 5}, {32, 2}, {124, 1}, {32, 1}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {'\n', 1}, 
    {9, 4}, {32, 7}, {92, 1}, {32, 7}, {47, 1}, {32, 3}, {124, 1}, {32, 1}, {124, 1}, {9, 1}, {32, 3}, {124, 1}, {32, 1}, {124, 1}, {32, 1}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {'\n', 1}, 
    {9, 5}, {92, 1}, {32, 5}, {47, 1}, {32, 4}, {124, 1}, {32, 1}, {124, 1}, {9, 1}, {32, 3}, {124, 1}, {32, 1}, {124, 1}, {32, 1}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {'\n', 1}, 
    {9, 5}, {32, 1}, {124, 1}, {32, 3}, {124, 1}, {9, 1}, {32, 3}, {124, 1}, {32, 1}, {124, 1}, {9, 1}, {32, 3}, {124, 1}, {32, 1}, {124, 1}, {32, 1}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {'\n', 1}, 
    {9, 5}, {32, 1}, {124, 1}, {32, 3}, {124, 1}, {9, 1}, {32, 3}, {124, 1}, {32, 1}, {124, 1}, {95, 5}, {124, 1}, {32, 1}, {124, 1}, {32, 1}, {124, 1}, {32, 3}, {124, 1}, {95, 3}, {124, 1}, {32, 3}, {124, 1}, {'\n', 1}, 
    {9, 5}, {32, 1}, {124, 1}, {32, 3}, {124, 1}, {9, 1}, {32, 3}, {124, 1}, {9, 1}, {32, 5}, {124, 1}, {32, 1}, {124, 1}, {9, 1}, {32, 3}, {124, 1}, {'\n', 1}, 
    {9, 5}, {32, 1}, {124, 1}, {95, 3}, {124, 1}, {9, 1}, {32, 3}, {92, 1}, {95, 9}, {47, 1}, {32, 1}, {92, 1}, {95, 11}, {47, 1}, {'\n', 1}, 
    
    
        };
        int i, j;
        for (i = 0; i < sizeof(foo) / sizeof(foo[0]); i++) {
            star_t bar = foo[i];
            for (j = 0; j < bar.count; j++) {
                printf("%c", (char)bar.ch);
            }
        }
        return 0;
    }
    Enjoy.

    Comments on this post

    • dwise1_aol agrees : Cool Program! I've been wanting to get the source code for a long time now!
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  8. #5
  9. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,174
    Rep Power
    2222
    If we had a nickel for every request that we do their homework for them, we wouldn't need all these annoying adverts.
  10. #6
  11. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    dwise: I'm glad you like the program sir. I actually wrote a program in perl that generates the necessary C code from an ASCII art text file. Please let me know if you want the source code for that.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  12. #7
  13. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,174
    Rep Power
    2222
    Though what I really liked about it was what happened the last time you gave it to someone wanting us to do his homework for him: he turned it in as his own work and the first time he ever saw it run was when his instructor ran it. And the fool had the nerve to come back and express his anger to you.

    Even more classic than when two others in the same class who were found out when their instructor visited our forum.

    Gotta love it when a plan comes together.
    Last edited by dwise1_aol; April 18th, 2012 at 02:26 PM.

IMN logo majestic logo threadwatch logo seochat tools logo