**C program for generic root**

#include<stdio.h>

int main(){

long int num,sum,r;

printf("\nEnter
a number:-");

scanf("%ld",&num);

while(num>10){

sum=0;

while(num){

r=num%10;

num=num/10;

sum+=r;

}

if(sum>10)

num=sum;

else

break;

}

printf("\nSum of
the digits in single digit is: %ld",sum);

return 0;

}

**C code for calculation of generic root in one line**

#include <stdio.h>

int main(){

int num,x;

printf("Enter any number: ");

scanf("%d",&num);

printf("Generic root: %d",(x=num%9)?x:9);

return 0;

}

**Sample output:**

Enter any number: 731

Generic root: 2

**Meaning of generic root**:

It sum of digits of a number unit
we don't get a single digit. For example:

Generic root of 456: 4 + 5 + 6 = 15
since 15 is two digit numbers so 1 + 5 = 6

So, generic root of 456 = 6

1. Write a c program to reverse any number.

2. Write a c program to find out sum of digit of given number.

2. Write a c program to find out sum of digit of given number.

10. Write a c program to find out NCR factor of given number.

11. How to convert string to int without using library functions in c

12. Program in c to print 1 to 100 without using loop

13. C program for swapping of two numbers

14. Program to find largest of n numbers in c

15. Split number into digits in c programming

16. C program to count number of digits in a number

11. How to convert string to int without using library functions in c

12. Program in c to print 1 to 100 without using loop

13. C program for swapping of two numbers

14. Program to find largest of n numbers in c

15. Split number into digits in c programming

16. C program to count number of digits in a number