Q10
Consider the function func shown below:
int func(int num) {
int count = 0;
while (num) {
count++;
num>>= 1;
}
return (count);
}The value returned by func(435) is __________.
Show answer without attempting
Answer: 9
GATE CS · C Programming · 2 questions
2 C Expressions and Control Flow questions from GATE CS papers (2014), each with the official answer key. Part of C Programming. Answer any question right here and it is marked straight away, or practise them one at a time.
int func(int num) {
int count = 0;
while (num) {
count++;
num>>= 1;
}
return (count);
}Answer: 9
Answer: B
0/20 correct0 marks