Computer Sciences > Gate 2018 > Recursion
Consider the following program written in pseudo-code. Assume that x and y are integers.

Count (x, y) {
    if (y !=1 ) {
        if (x !=1) {
            print("*");
            Count (x/2, y);
      }
    else {
      y=y-1;
      Count (1024, y);
     }
   }
}

The number of times that the print statement is executed by the call Count(1024, 1024) is _______ .

Correct : a

Similar Questions

Consider the following C program: #include<stdio.h> int r(){     int static num=7;     return num--; } int main() {     for...
#239 MCQ
Consider the following C program: void convert(int n) { &nbsp; &nbsp; if (n < 0) &nbsp; &nbsp; printf(β€œ % d”, n); &nbsp; &nbsp; else { &nbs...
#241 MCQ
Consider the following C function. int fun (int n) { &nbsp; &nbsp; int x=1, k; &nbsp; &nbsp; if (n==1) return x; &nbsp; &nbsp; for (k=1; k < n; ++k) &...
#527 Fill in the Blanks

Related Topics

count function pseudo code GATE computer science 2018 recursive print statement count Count(1024 1024) recursion depth 1024 print statement execution binary tree recursion GATE 2018 Computer Science

Unique Visitor Count

Total Unique Visitors

Loading......