Solution:
The provided function is
$f(x)=\left\{\begin{array}{ccc}\frac{k \cos x}{\pi-2 x}, & \text { if } x \neq \frac{\pi}{2} \\ 3, & \text { if } x=\frac{\pi}{2}\end{array}\right.$
$\lim _{x \rightarrow \frac{\pi}{2}} f(x)=\lim _{x \rightarrow \frac{\pi}{2}} \frac{k \cos x}{\pi-2 x}$
Therefore, $x \rightarrow \frac{\pi}{2}$
Now this implies that, $x \neq \frac{\pi}{2}$
Putting the value of $x=\frac{\pi}{2}+h$ where $h \rightarrow 0$
$=\lim _{h \rightarrow 0} \frac{k \cos \left(\frac{\pi}{2}+h\right)}{\pi-2\left(\frac{\pi}{2}+h\right)}$
$\lim _{=h \rightarrow 0} \frac{-k \sin h}{-2 h}$
$=\frac{k}{2} \times \lim _{h \rightarrow 0} \frac{\sin h}{h}$
$=\frac{k}{2} \ldots \ldots \ldots$..(1)
And $f\left(\frac{\pi}{2}\right)=3$…….(2)
Provided, $f(x)=3$ when $x=\frac{\pi}{2}$
Since we know, $f(x)$ is continuous at $x=\pi / 2$.
$\lim _{x \rightarrow \frac{\pi}{2}} f(x)=f\left(\frac{\pi}{2}\right)$
From eq. (1) and eq. (2), we now have
$\frac{k}{2}=3$
$k=6$
As a result, the value of $\mathrm{k}$ is 6