First off, that's not C#, it's C - they may look similar, but they are very, very different languages! Tagging your questions with the wrong languages can mean you wait a lot longer for a reply ...
Second, indent your code! It makes it a whole lot easier to read:
printf("Enter a number:");
printf("Enter 'M': ");
K = num & ~(1 << M);
printf("Updated value of num is %d \n", K);
It's less relevant with trivial fragmente like this, but get into the habit early and it can save you hours of frustration later.
Third, when you post a question, you need to explain what problem you have met: we have no idea what values you entered, or what happened when you did - so we have to guess and that may not address the problem you have found at all!
Start here: Asking questions is a skill
] and think about what you need to know, and what you need to tell us in order to get help.
Do note that when you try to check if the Nth bit of
is set, you overwrite the existing value - which means you cannot complete the task as you don't have the original value entered by the user any more!
Instead of shifting
at all, I'd shift
N places to the left and AND that with num to check if it is set.