(Solved):Q: Write a C++ prog…

Question:

Question

Write a C++ program using recursive function that ask for a number K then the recursive function displays binary numbers of size K without consecutive 1’s.

Hint:

Input: K = 3

Output: 000, 001, 010,100,101

Expert Answer:

Step 1

Answer in step2

Step 2

#Source_code

#include <bits/stdc++.h>
using namespace std;
void generate(int K,

Leave a Comment