Tuesday, 9 July 2013

C program to calculate generic root of any number

What is Generic root of a number?Find the sum of digits of the number until we get a single digit output. And the resultant number is called generic number.Example: 4567914 + 5 + 6 + 7 + 9 + 1 = 323 + 2 = 5So, 5 is the generic root of 456791.Write a C program to calculate generic root of the given number.