need help on this program output

Discussion in 'C' started by carl, Jul 15, 2006.

  1. carl

    carl New Member

    Joined:
    Jul 15, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi all experts out there ....

    need some ...new to programming..

    below is the program for which i need to know the the process....I know the aswer which is = 9.....but need to know how come... what is the calculation.

    Consider the following program segment:

    i = 6720; j = 4;

    WHILE ( (i % j) = = 0){

    i = i / j;

    j = j + 1;

    }

    plz help...need it asap.

    thanks & regards,

    carl

    carl.banderas@rediffmail.com
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    The loop continues till it does not satisfy (i % j) = = 0 and when it satisfy the value is 9.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice