Diagonal of a Regular Decagon | Java program to find the diagonal of a regular decdiagonal ; Function to return the diagonal of a regular decdiagonal ; side cannot be negative ; length of the diagonal ; Driver code
import java . util . * ; import java . lang . * ; import java . io . * ; public class GFG { static double decdiagonal ( double a ) { if ( a < 0 ) return - 1 ; double d = 1.902 * a ; return d ; } public static void main ( String [ ] args ) { int a = 9 ; System . out . println ( decdiagonal ( a ) ) ; } }