Java program for find sine cosine and tan of a number

Java program for find sine of a number

Java program for find cosine of a number

Java program for find tan of a number

Program:-

import java.util.Scanner;

class group{
public static void main(String angt[]){
Scanner data = new Scanner(System.in);
double num,num1;

System.out.println("Enter a number");
num1=data.nextDouble();

num=Math.sin(num1);
System.out.println("sine Answer:"+num);

num=Math.cos(num1);
System.out.println("cosine Answer:"+num);

num=Math.tan(num1);
System.out.println("tan Answer:"+num);

}
}

Output:-

Enter a number
30
sine Answer:-0.9880316240928618
cosine Answer:0.15425144988758405
tan Answer:-6.405331196646276


Learn Java:-
Java codes

Java Programs:-
List of Java Programs

One Comment

  1. it work proper i want all the value sin cos tan csc cot etc

    ReplyDelete

Add your comments here

Back to Top