f(x) \(=\begin{cases}k\,cos\,x;&x\leq0\\2^x-k;&x>0\end{cases}\)
f(0-) \(=\underset{x\rightarrow0}{Lim}\) k cos x = k cos 0 = k
f(0+) \(=\underset{x\rightarrow0}{Lim}\) 2x - k = 20 - k = 1 - k
∵ f(x) is continuous at x = 0
∴ f(0-) = f(0+)
⇒ k = 1 - k
⇒ 2k = 1
⇒ k = 1/2.