To add on to my Stupid Question

This is a discussion on To add on to my Stupid Question within the C++ Programming forums, part of the General Programming Boards category; Ok here is what I am doing. I am comparing 6 numbers for which number has the most digits. For ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    34

    To add on to my Stupid Question

    Ok here is what I am doing. I am comparing 6 numbers for which number has the most digits. For some reason my loop goes through and counts my smallest number.

    Here is my code:

    for ( int x = 0; x < z; x++ )
    {
    number = num1[x];
    e = d;
    digitCnt = 0;
    while(number)
    {
    number=number/10;
    digitCnt++;
    }
    d = digitCnt;
    if ( e > d )
    f = d;
    }

    What am I doing wrong?

    The Ski
    http://members.ebay.com/aboutme/the_ski/

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    34
    Disregard this post as well.

    The Ski
    http://members.ebay.com/aboutme/the_ski/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 11-04-2005, 12:17 AM
  2. Probably A Stupid Question
    By samGwilliam in forum C++ Programming
    Replies: 27
    Last Post: 07-10-2005, 02:06 PM
  3. Stupid Question
    By digdug4life in forum C++ Programming
    Replies: 22
    Last Post: 05-17-2005, 12:43 PM
  4. stupid, stupid question
    By xelitex in forum C++ Programming
    Replies: 5
    Last Post: 12-22-2004, 08:22 PM
  5. Stupid question: What does Debugger do?
    By napkin111 in forum C++ Programming
    Replies: 6
    Last Post: 05-02-2002, 11:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21