Recent questions tagged identify-function

0 votes
2 answers
64
Consider the C function func shown below: int func(int num) { int count = 0; while (num) { count++; num>>= 1; } return (count); }The value returned by func(0235) is _____...
62 votes
12 answers
72
29 votes
3 answers
75
Let $x$ be an integer which can take a value of $0$ or $1$. The statementif (x == 0) x = 1; else x = 0;is equivalent to which one of the following ?$x = 1 + x;$$x = 1 - ...
15 votes
4 answers
78
Consider the code fragment written in C below :void f (int n) { if (n <=1) { printf ("%d", n); } else { f (n/2); printf ("%d", n%2); } }What does f(173) print?$010110101$...
21 votes
1 answer
82
In the following Pascal program segment, what is the value of X after the execution of the program segment?X := -10; Y := 20; If X Y then if X < 0 then X := abs(X) else ...
19 votes
3 answers
83
19 votes
3 answers
85
What does the following code do?var a, b: integer; begin a:=a+b; b:=a-b; a:a-b; end;exchanges $a$ and $b$doubles $a$ and stores in $b$doubles $b$ and stores in $a$leaves ...
27 votes
5 answers
88
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 ______...