C code for calculation of generic root in one line

Posted By: Matpal - January 25, 2012
#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;
}

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.