Comments on: [11/13] Java Foundations Certification: Exception Handling https://softuni.org/code-lessons/java-foundations-certification-exception-handling/ Learn Programming and Start a Developer Job Fri, 01 Jul 2022 07:33:34 +0000 hourly 1 https://wordpress.org/?v=6.1.3 By: Sanya Kasarova https://softuni.org/code-lessons/java-foundations-certification-exception-handling/#comment-1141 Thu, 09 Dec 2021 11:01:52 +0000 https://softuni.org/?p=9024#comment-1141 In reply to AJAY Rathi.

Hello,
You can use the following code to calculate sin(180):
double angle = 180;
double sin180 = Math.sin(Math.toRadians(angle));
System.out.println(Math.round(sin180));

Notice we use Math.round() at the end. Otherwise, you will get a number very close to 0, but not exactly zero.
We hope that was helpful. We’re available for any questions to follow.
Have a great day!

]]>
By: AJAY Rathi https://softuni.org/code-lessons/java-foundations-certification-exception-handling/#comment-1135 Wed, 08 Dec 2021 11:16:29 +0000 https://softuni.org/?p=9024#comment-1135 java code for
sin(180 )=?
//180 in degree

]]>