Simple Sudoku Solver
Your isAvailable() is wrong.

You check if a number is within the row or col. But you also need to check if it is within the same (3*3) square.

int isAvailable(int puzzle[][9], int row, int col, int num)
{
    int sqCol = col % 3 * 3;
    int sqRow = row % 3 * 3;
    for (int i = 0; i&lt;9; ++i)
    {
        if (puzzle[row][i] == num) return 0;
        if (puzzle[i][col] == num) return 0;

        // You need to add this test.
        if (puzzle[sqRow + (i % 3)][sqCol + (i / 3)] == num) return 0;
    }
    return 1;
}


Rather than having you loop from 0 and then using i+1 why not loop from 1?

for (int i = 0; i&lt;9; ++i)

// I would just do 
for (int i = 1; i&lt;=9; ++i)
     Now intuitively use i


Your test for reaching the end of line and end of col is in several places. Rather than test on the call. Just increment the col and handle overflow at the top of the function (in one place). This will greately simplify the whole thing.

int solveSudoku(int puzzle[][9], int row, int col)
{
    if (col == 9) {
        col = 0;
        row++;
    }
    if (row == 9) {
        return 1;
    }

    if (puzzle[row][col] != 0) {
        return solveSudoku(puzzle, row, col + 1);
    }

    for (int i = 1; i &lt;= 9; ++i)
    {
        if (isAvailable(puzzle, row, col, i))
        {
            puzzle[row][col] = i;
            if (solveSudoku(puzzle, row, col + 1))
                return 1;
            }
        }
    }
    puzzle[row][col] = 0;
    return 0;
}