Computer Science, asked by tabu2814, 2 months ago

Write a program that defines a function named increase_decrease() and it takes three numbers as it arguments. It must return the string "increasing" if the numbers are in an ascending order, or return "decreasing" if all numbers are in a descending order, or return "neither" if all numbers are not increasing nor decreasing. Here, increasing" means "strictly increasing", with each value larger than its predecessor. The sequence 3 4 4 would not be considered increasing. Same thing applies with decreasing.

Answers

Answered by Aryansingh001
2

Answer:

compile it on   java site by self or head toward s.o.l.o  learn app dear

Explanation:

mport java.util.Scanner;

public class Exercise31 {

  public static void main(String[] args)

   {

       Scanner in = new Scanner(System.in);

       System.out.print("Input first number: ");

       double x = in.nextDouble();

       System.out.print("Input second number: ");

       double y = in.nextDouble();

      System.out.print("Input third number: ");

       double z = in.nextDouble();

       if (x < y && y < z)

       {

           System.out.println("Increasing order");

       }

       else if (x > y && y > z)

       {

           System.out.println("Decreasing order");

       }

       else

       {

           System.out.println("Neither increasing or decreasing order");

       }

   }

}

Similar questions