Jump to content

sharpenyourteeth

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by sharpenyourteeth

  1. Correct me if I'm wrong but wont this work?

    int minValue(int data[])
    
    {
    
        int result = data[0], i = 0;
    
    
    
        while (data[i] != '0')
    
        {
    
            if (data[i] < result)
    
                result = data[i];
    
        i++;
    
        }
    
        return(result); 
    
    }

    that would work if you assumed 0, or null, was the last value in the array, otherwise the loop when just stop when it came across a 0. only character arrays are null terminated in C.

  2. Well even if those programs are credible, what are you going to do with them? I think you were asked to write a program yourself, so the first thing you should do is figure out what a valid credit card number is. Here are some links that might help.

    http://en.wikipedia.org/wiki/Credit_card_n...GenCardFeatures

    http://money.howstuffworks.com/credit-card2.htm

    http://www.avdf.com/feb99/art_vb003.html

    So figure out what it is, then once you're ready to start programming post back here and I'm sure someone will help you get started. You may as well take this opportunity to learn a thing or two, instead of googling for already written program.

×
×
  • Create New...