Write a code fragment that prints true if the double variabl

Write a code fragment that prints true if the double variables x and y are both strictly between 0 and 1 and false otherwise.

Solution

As you haven\'t mentioned the language to print?

In the place of print write the langulage code. just for instance i have used c language.

Here is code:

if ( (0 < x) && (x < 1) && (0 < y) && (y < 1)) {
System.out.println(\"true\");
} else {
System.out.println(\"false\");
}

Write a code fragment that prints true if the double variables x and y are both strictly between 0 and 1 and false otherwise.SolutionAs you haven\'t mentioned t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site