Given a variable
 
float num;
 
How it should be initialized so that the following code
 
if (num == num) 
    Console.WriteLine("Equal"); 
else 
    Console.WriteLine("Not equal");
 
would return
  Not equal
Explanation
0 / 0.0F operator produces a NAN result (not a number), Thus the (num == num) expression can not be considered from a logical point of view

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты