#include <stdio.h>
main ()
{
int n,r;
printf("Enter a Number:\n");
scanf("%d",&n);
r=n%9;
if(r==0)
{
printf("Lucky Number : 9");
}else
{
printf("Lucky Number : %d",r);
}
}
Note: Need to be arranged in compiler after copied
OutPut:
Enter a Number:
1239
Lucky Number : 6