Ad
  • Default User Avatar

    In C, if the result returned without string terminator some test didn't pass. This might help others. I wasted lot of time before figure that out.

  • Default User Avatar

    Can somebody tell me why i got error on this test?
    i printed values by printf on the screen.
    Time: 22ms Passed: 14 Failed: 1
    -121
    -115
    -114
    -110
    -106
    -105
    -102
    -100
    -71
    -63
    -54
    -49
    -45
    -40
    -18
    -17
    -6
    -4
    2
    8
    12
    33
    60
    61
    62
    76
    76
    90
    93
    101
    114
    120
    124
    Mean = -6.303030
    median = -6.000000
    case median > Mean -6.000000 > -6.303030
    The expression strcmp(result, expected) == 0 is false.

  • Default User Avatar

    Return is given by function signature int* sumFracts(int lst[][2], int row) and (see function dotest in "Sample Tests") this result is freed.

  • Default User Avatar
  • Default User Avatar

    Hi, i'm beginner. Have a problem when try to return result. I calculated N and D correctly, then i create new array int x[] = {N, D}; and trying to return x;
    But it doesn't work, every time i got errors, that returned values are not match with expected. What should i return in this function?
    Language C. Tnx)

  • Default User Avatar

    When you ask for help post a question, not an issue.

  • Default User Avatar

    Hi, i'm beginner. Have a problem when try to return result. I calculated N and D correctly, then i create new array int x[] = {N, D}; and trying to return x;
    But it doesn't work, every time i got errors, that returned values are not match with expected. What should i return in this function?
    Language C. Tnx)

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    You need to have the cmath library to use the 'sqrt' operation. Just add:

    #include cmath

    to the top of your program and it should fix it. Make sure to put "cmath" in angle brackets too.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution