GeekInterview.com
Series: Subject: Topic:
Question: 323 of 587

Recursive function to compute the number of sequences of n binary digits.

How to Write a recursive function to compute the number of sequences of n binary digits that do not contain two 1s in a row. Write a main function to test this function.

Input:Input consists of the number of binary digits in the sequence.

Output:Output consists of the number of sequences of given binary digits that do not contain two 1s in a row

Sample Input:
Enter the number of binary digits in the sequence:
5
Sample Output:
Number of sequences of 5 binary digits that do not contain two 1s in a row is:
13
Asked by: souji1425 | Member Since Jun-2006 | Asked on: Jul 17th, 2006

View all questions by souji1425

This Question is not yet answered!

Related Open Questions

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.