Answers for "given below are two statements labelled assertion and reason."

0

given below are two statements labelled assertion and reason.

import java.lang.Math;
import java.util.Scanner;
public class SensorThreshold {
   public static void main(String[] args) {
      Scanner scnr = new Scanner(System.in);
      double targetValue;
      double sensorReading;

      targetValue = scnr.nextDouble();
      sensorReading = scnr.nextDouble();

      if (Math.abs(sensorReading - targetValue) < 0.001) {
         System.out.println("Equal");
      }
      else {
         System.out.println("Not equal");
      }
   }
}
Posted by: Guest on November-20-2020

Code answers related to "given below are two statements labelled assertion and reason."

Code answers related to "Javascript"

Browse Popular Code Answers by Language