Computer Sciences > Gate 2020 > function
Consider the following C functions.
int fun1(int n)
{
static int i= 0;
if (n > 0) {
++i;
fun1(n-1);
}
return (i);
}
int fun2(int n) {
static int i= 0;
if (n>0) {
i = i+ fun1 (n) ;
fun2(n-1) ;
}
return (i);
}
The return value of fun2(5) is ________ .{
static int i= 0;
if (n > 0) {
++i;
fun1(n-1);
}
return (i);
}
int fun2(int n) {
static int i= 0;
if (n>0) {
i = i+ fun1 (n) ;
fun2(n-1) ;
}
return (i);
}
Correct : 55
Similar Questions
Consider the following C program:
#include<stdio.h>
int counter = 0;
int calc(int a, int b) {
int c;
counter++;...
Consider the following C functions.
int tob (int b, int* arr) {
int i;
for (i = 0; b>0; i++) {
if (b%2)
&nbs...
A palindrome is a word that reads the same forwards and backwards. In a game
of words, a player has the following two plates painted with letters.
From...
Total Unique Visitors
Loading......