Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Recursive Functions
Recursion is a process by which a function includes itself with a condition for its safe exit. It is best suitable for a recursive problem. A typical example is the factorial problem, the programs without and with recursive functions are shown below.
void main()
{
long factorial ( int num); // Forward declaration of
//a function
int num;
printf("\n Enter a number:");
scanf("5d",&num);
printf(" Factorial of 5d is %ld",num,factorial(num));
}
long factorial(int num) // Non recursive
long f=1;
while ( n)
f = f * n;
n--;
return(f);
long factorial(int num) // Recursive
if(n == 1)
return (1);
else
return( n* factorial(n-1));
C program to print fibonacci series: int fibo(long int); void main() { long int a=0,n; printf ("how many terms\n");
what is the function of spanning tree in graph algorithm?
Q: When should you employ multiple inheritance? A:There are three acceptable answers:- "Rarely," "Never," and "while the problem domain cannot be modeled accurately any
C Program for 5 FUNCTION OF VOWELS, CNT_WORDS, REVERSE void input(char a[]); void output(char a[]); void reverse(char a[], char b[]); char poli(char a[], char b[]);
There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that
#question.to determine the area of a triangle,rectangle and trapezium
#include int main() { int T; int N; int i; scanf("%d",&T)
Suppose we use Lists to represent a movie which has a title, cast and year. For example, the following list represents the movie, "Die Hardly", with the cast "Bruce Willing" and "T
Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code
Operation Files 2.1. Your program should open and read the file specified by the first command line argument of the program. 2.2. The first line of the file contains an integer
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd