The value of k that makes f continuous for

f(x) = {(5*sin(x))/x, x<=0
{cos x+k, x>0

is k = ?

we know lim sin(x)/x = 1 as x-->0

so, lim f(x) = 5 as x --> 0-
cos(0) = 1
so f(x) = cos(x)+4 for x>0 will make the limit 5 from either side.

However, f(x) is still not defined for x=0! Just because the limit exists, that does not make f continuous. It still has a hole at x=0. You need to change f(x) to be

f(x) =
{(5*sin(x))/x, x<0
{cos x+k, x>=0