Find out generic root of a number by c program | C program for generic root

Find out generic root of a number by c program | C program for generic root | Generic root in C



#include
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

No comments:

Post a Comment