February 13th, 2022
[Scroll to the bottom of this page to discuss stuff].
n
from the user and print the first n
terms of the Fibonacci series using recursive function.n
and find the sum of first n
natural numbers using a recursive function.n
and find the sum of first n
even numbers using a recursive function.n
and find the sum of the digits of the number n
using a recursive function.n
and a number p
and find the value of n
raised to the power p
using a recursive function.a
and d
) as input and find the sum of an Arithmetic Progression (AP) using recursion.Given a function defined as:
f(1) = 3
f(n) = 2 * f(n - 1) - 1
WAP to input an integer n
and display the sum of first n
terms of the above series using recursion.
Give the output of the following code:
#include <stdio.h>
void print_count()
{
static int count1 = 1;
int count2 = 1;
printf( "Count1 = %d, Count2 = %d\n", count1++, count2++);
}
int main()
{
print_count();
print_count();
print_count();
return 0;
}
Count1 = 1, Count2 = 1
Count1 = 2, Count2 = 1
Count1 = 3, Count2 = 1