Create a class that includes a data member that holds a “serial number” for each object created
from the class. That is, the first object created will be numbered 1, the second 2, and so on. Add a
member function that permits an object to report its own serial number. Then write a main ()
program that creates three objects and queries each one about its serial number. They should
respond I am object number 2, and so on.
Write a recursive method that has one integer parameter (n) and returns the number of binary strings of length n that do not have two consecutive 1's. You should not use any loops in your solution. For example, for n = 4, the number of binary strings of length 4 that do not contain two consecutive 1's is 8:
Question: A state is divided into R*C cities.The government has launched an initiative to find the cities w...
A state is divided into R*C cities.The government has launched an initiative to find the cities which are dominated by coders. Each city may or may not have coders residing in it. If the city is dominated by coders, it is marked with 1 else it is marked with 0. Two cities are termed as connected cities if they both are dominated by coders and can be reached by moving vertically, horizontally, or diagonally.