Answer to Question choice-4

There is no else in front of the second if. So one of the statements y = 0 or y = 1 must be done. So y can never be made −1. Here is a corrected version.
  if(x < 0)
  {
    y = -1;
  }
  else if(x == 0)
  {
    y = 0;
  }
  else
  {
    y = 1;
  }
If you prefer to use a conditional expression, make it easy to read. The coding standards ask you to avoid complicated expressions that are difficult to read.
  y = (x < 0)  ? 1 :
      (x == 0) ? 0
               : -1;