Skip to content

Tag Archives: Algorithms-Recursion

What does the following function do? int fun(int x, int y) {     if (y == 0)   return 0;     return (x + fun(x, y-1)); } (A)… Read More
What does the following function print for n = 25? void fun(int n) {   if (n == 0)     return;      printf("%d", n%2);   fun(n/2); }   (A)… Read More
Consider the following recursive function fun(x, y). What is the value of fun(4, 3) int fun(int x, int y)  {   if (x == 0)     return… Read More
Predict output of following program #include <stdio.h>    int fun(int n) {     if (n == 4)        return n;     else return 2*fun(n+1); }       int… Read More

Start Your Coding Journey Now!