C code for calculation of generic root in one line

Posted By: Matpal Media - 1:43 AM
#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.