Scala Program to Convert the Angle Measured in the Degree to Radian Using Scala.math.toradians() Function

You are currently viewing Scala Program to Convert the Angle Measured in the Degree to Radian Using Scala.math.toradians() Function

Scala program to convert the angle measured in the degree to radian using scala.math.toRadians() function

// Scala program to convert the angle measured 
// degree to radian

object Sample{  
    def main(args:Array[String]){  
        var num:Double = 0;
        var res:Double = 0;
           
        print("Enter degree: ")
        num=scala.io.StdIn.readDouble()
        
        res= scala.math.toRadians(num)
        println("Angle in radian: "+res);
    }  
}
Enter degree: 60
Angle in radian: 1.0471975511965976

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply