edited by
11,374 views
27 votes
27 votes

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 ________

edited by

5 Answers

0 votes
0 votes

While condition is true 9 times only

hence output is 9 as count was given only 9 times chance to update itself.

 

Thanks

Answer:

Related questions

5 votes
5 votes
2 answers
1
Souvik33 asked Jan 15, 2023
1,095 views
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:69Will ...
25 votes
25 votes
3 answers
3
go_editor asked Sep 28, 2014
9,764 views
The number of distinct positive integral factors of $2014$ is _____________
33 votes
33 votes
3 answers
4
go_editor asked Sep 28, 2014
7,210 views
Given an instance of the STUDENTS relation as shown as below$$\begin{array}{|c|c|c|c|c|} \hline \textbf {StudentID} & \textbf{StudentName} & \textbf{StudentEmail} & \text...