M
M
Maxim Romashko2017-10-06 11:58:25
C++ / C#
Maxim Romashko, 2017-10-06 11:58:25

Why are two doubles not compared?

double x, y;
  printf("Input x and y: "); scanf_s("%lf", &x); scanf_s("%lf", &y);
  if (y > 1)
  {
    printf("Vasha tochka prinadleshit oblasti: x(-infinity;+infinity), y[1;+infinity)\n");
  }
  else if (y >= -3.0 && y <= -4.0)
  {
    printf("Vasha tochka prinadleshit oblasti: x(-infinity;+infinity), y[-3;-4]\n");
  }

Such is the code. The second condition does not work, even though you hit the wall. Please tell me what is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-10-06
@md5inj

Because the condition must be like this
if you want to get a match from -3 to -4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question