no spam otherwise will be reported. you have to write a Java program which should be suitable for class 9 student. if you don't know, don't reply
Share
no spam otherwise will be reported. you have to write a Java program which should be suitable for class 9 student. if you don't know, don't reply
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
//SMALLEST OF TWO INTEGERS
class Min
{
public static void main(String args[])
{
double x = 10;
double y = 24;
double A=Math.min(x,y);
System.out.println("A= "+A);
}
}
//Prg to find square root a number
import java.util.Scanner;
class SqRoot
{
public static void main(String args[])
{
System.out.println("Enter a number ");
Scanner K=new Scanner(System.in);
int N=K.nextInt();
double S=Math.sqrt(N);
System.out.println("Square root= "+S);
}
}
//Program to find cube root
class CubeRoot
{
public static void main
{
int N = 9;
double C=Math.cbrt(N);
System.out.println("Cube root= "+C);
}
}
Note:- If you are doing user input use scanner class like I have used in square root.
Thank You