Question 31
void foo(int n, int sum)
{
int k = 0, j = 0;
if (n == 0) return;
k = n % 10;
j = n / 10;
sum = sum + k;
foo (j, sum);
printf (\"%d,\", k);
}
int main ()
{
int a = 2048, sum = 0;
foo (a, sum);
printf (\"%d\\n\", sum);
getchar();
}
Question 32
double foo (double); /* Line 1 */
int main()
{
double da, db;
// input da
db = foo(da);
}
double foo(double a)
{
return a;
}
Question 33
Question 34
A Priority-Queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is given below: 10, 8, 5, 3, 2 Two new elements ”1‘ and ”7‘ are inserted in the heap in that order. The level-order traversal of the heap after the insertion of the elements is:
Question 36
Question 37
Question 38
Question 39
Question 40
There are 90 questions to complete.