Menu

Pleasee Solve Problems C Programming Language Deals Recursion Really Need Help Thank Advan Q43855201

Can you pleasee solve these problems in c++ programminglanguage. It deals with recursion. I really need your help. Thankyou in advance!!!

1. There are n people in a room, where n is an integer greaterthan or equal to 2. Each person shakes hands once with every otherperson. What is the total number of handshakes in the room? Write arecursive function to solve this problem, with the followingheader:
int handshake(int n)
where handshake(n) returns the total number of handshakes for npeople in the room. To get you started, if there are only one ortwo people in the room, then:
handshake(1) = 0 handshake(2) = 1
2. Write a recursive function that returns true if an input stringis a palindrome and false if it is not. You can do this by checkingif the first character equals the last character, and if so, make arecursive call with the input string minus the first and lastcharacters. You will have to define a suitable stopping condition.Test your function with several palindromes andnonpalindromes.
3. Write a recursive function definition for a function that hasone parameter n of type int and that returns the nth Fibonaccinumber

Expert Answer


Answer to Can you pleasee solve these problems in c++ programming language. It deals with recursion. I really need your help. Than…

OR