Scala Program to Convert the Angle Measured Radian to a Degree Using Scala.math.todegrees() Function

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

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

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

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

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