KodeGod.com

011. Technical interview question: Give the output of the following code snippet

 
int main()
{
  int number = 147; //Any number.
  int res;
  if(number)
    res = number % 9 == 0 ? 9 : number % 9 ;
  else
    res = 0;
    printf("%d", res);
getch();
}