Program to calculate length of diagonal of a square | Java program for the above approach ; Function to find the length of the diagonal of a square of a given side ; Driver Code
import java . util . * ; class GFG { static double findDiagonal ( double s ) { return ( double ) Math . sqrt ( 2 ) * s ; } public static void main ( String [ ] args ) { double S = 10 ; System . out . print ( findDiagonal ( S ) ) ; } }