Well for one, you can't throw an if() statement and other PHP code into the middle of a string. For another, '%s' is just a placeholder that is evaluated internally in the printf() function; outside of that function (e.g. in an if() statement), it's just a literal percent sign followed by the letter 's'.
Since you don't gain any benefit by using printf() here, the easiest solution would just be to get rid of it:
while($row = mysql_fetch_array($result)) {
echo "<tr><td>";
if ($row["tipo"] == 0)
{
echo "Deposito";
} else {
echo "Gasto";
}
echo "</td><td>$row[cantidad]</td><td>$row[fecha]</td></tr>\n";
}
Or, more compactly (using the ternary operator):
while($row = mysql_fetch_array($result))
echo "<tr><td>" . ($row["tipo"] == 0 ? "Deposito" : "Gasto") . "</td><td>$row[cantidad]</td><td>$row[fecha]</td></tr>\n";