Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  • Thread Tools
  • Rate This Thread
  1. #1
    New to the CF scene
    Join Date
    May 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Need help with this question please !!

    What does this function return ?

    function (vrati_broj) {

    !temp a,,i2
    !temp b,,i2
    !temp c,,i2
    !temp i,,i2

    tmp.b=5
    tmp.a=2
    tmp.c = tmp.b - tmp.a
    if (tmp.c == 2) {
    tmp.c = 5
    } else {
    tmp.b = 7
    }

    for (tmp.i=0; tmp.i < tmp.c; tmp.i=tmp.i+1) {
    while (tmp.i>4) {
    if (tmp.i<7) {
    return tmp.i
    }
    }
    }
    return tmp.i
    }

  2. #2
    Senior Coder
    Join Date
    Aug 2010
    Posts
    1,123
    Thanks
    30
    Thanked 250 Times in 248 Posts
    This function has no
    chance of returning.
    The first problem is
    there is no way to
    call this function,
    there are many
    more problems.

    Welcome to the Forum.
    Cleverness is serviceable for
    everything,
    sufficient in nothing.

  3. #3
    New to the CF scene
    Join Date
    May 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    Quote Originally Posted by DaveyErwin View Post
    This function has no
    chance of returning.
    The first problem is
    there is no way to
    call this function,
    there are many
    more problems.

    Welcome to the Forum.
    Exactly what i tought, I got few task to do for a job interview and this was 1 of them, and ofc the only one I did not do... So I posted it here to see if any1 knows..


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •