Program to calculate length of diagonal of a square | C ++ program for the above approach ; Function to find the length of the diagonal of a square of a given side ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; double findDiagonal ( double s ) { return sqrt ( 2 ) * s ; } int main ( ) { double S = 10 ; cout << findDiagonal ( S ) ; return 0 ; }