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();
}
Watch all videos like this

Leave a Reply

Your email address will not be published. Required fields are marked *