sindujamanoj
Nov 4, 2016, 07:35 AM
Write a program to accept a set of son, father names and print the number of grandchildren for the given person.The program can assume that the names are all unique and represented with only one letter.
(R,K) (S,K) (J,K),(L,P),(G,K),(T,R),(M,G)
Eg:
Person name: K
Output:
K has 3
(R,K) (S,K) (J,K),(L,P),(G,K),(T,R),(M,G)
Eg:
Person name: K
Output:
K has 3