C Program to print all Perfect number till N

OUTPUT: