int func2(int m, int n) {
if (n == 0)
return 0;
else
return m + func2(m, n-1);
}
2
3
5
6
Question 35
int func1(int m, int n) {
if (m==n || n==1)
return 1;
else
return func1(m-1,n-1) + n*func1(m-1,n);
}
m > = 0 and n >= 0
m >= 0 and n >= 1
m >= 1 and n >= 0
m >= 1 and n >= 1
Question 36
int func3(int m, int n) {
if (m < n)
return 0;
else
return 1 + func3(m-n, n);
}
-5
0
1
5
A
B
C
D
Question 38
int func1(int m, int n) {
if (m==n || n==1)
return 1;
else
return func1(m-1,n-1) + n*func1(m-1,n);
}
3
5
7
9
Question 39
void decToBin(int num, int base)
{
if(num > 0)
{
decToBin(num/base, base);
cout<
}
}
decToBin(4, 2)
decToBin(2, 4)
decToBin(9, 2)
decToBin(8, 1)
Question 40
int func2(int m, int n) {
if (n == 0)
return 0;
else
return m + func2(m, n-1);
}
n >= 0
m > n
m >= 0
n > m
