Join the social network of Tech Nerds, increase skill rank, get work, manage projects...

• program to find out generic root of any number on C language

• 0
• 0
• 0
• 0
• 0
• 0
• 0
• 0
• 256
Comment on it

generic root means: in this we do addition of a given number until reached a single digit after addition . For example: Generic root of 784: 7 + 8 + 4 = 19 since 19 is a two digit numbers so 1 + 9 = 10.then again add 1 +0=1 So, generic root of 784 = 1

``` #include<stdio.h>
int main(){
long int num, sum, r;
printf("\n Enter a number:-");
scanf("%d",&amp;num);
while(num&gt;10){
sum=0;
while(num)
{
r=num%10;                           //we are taking modulus of the number
num=num/10;                         //now dividing number by 10
sum=sum+r;                              //take variable sum and store the value of r
}
if(sum&gt;10)
num=sum;
else
break;
}
printf("\n Sum of the digits in single digit is: %d",sum);
return 0;
}
```
```Sample output:
Enter any number: 245
Generic root: 2
```

0 Comment(s)

Sign In
OR
OR
Register

Sign up using

OR
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password:

• Hire
• Post Projects

Post Projects

• All at 0 Cost ....
• Post Tech Job
• Select Best Bidder
• Track the Project
• Approve Work and Pay safely
• Browse Nerds
• Work
• Find Projects Find Projects
• UI Design and UX
• Software Engineering
View more...
View less...
• Marketing
• General
• Business
• Manage
• Company Company

Manage Company

• All at 0 Cost ....
• Manage Company and Employee Profiles
• Use Online Project Management Tools for Free
• Company wide Employee Productivity Reports
• Knowledge Sharing and Collaboration Tools
• Get Sales Lead and Bid for Tech Projects
• Send Invoices and Receive Payment Safely
• Learn
• Nerd Digest Nerd Digest
• UI Design and UX
• Software Engineering
View more...
View less...
• Marketing
• General
• Business
• Tech Q & A Tech Q & A
• UI Design and UX
• Software Engineering
View more...
View less...
• Marketing
• General
• Business
• Record & Share

Desktop Recording Tool

• All at 0 Cost ....
• Online tool for Recording Desktop Activity and Audio
• Store and Share from the Cloud
• Creating Software Product Demos
• Creating video tutorials
• Recording and Reporting Software and Project issues as videos
• Ask Tech Query
• Post Blogs