Maximize a value for a semicircle of given radius | C ++ program to find the maximum value of F ; Function to find the maximum value of F ; using the formula derived for getting the maximum value of F ; Drivers code
#include <bits/stdc++.h> NEW_LINE using namespace std ; double maximumValueOfF ( int R ) { return 4 * R * R + 0.25 ; } int main ( ) { int R = 3 ; printf ( " % .2f " , maximumValueOfF ( R ) ) ; return 0 ; }