Program to calculate area of inner circle which passes through center of outer circle and touches its circumference | C ++ implementation of the above approach ; Function calculate the area of the inner circle ; the radius cannot be negative ; area of the circle ; Driver Code
#include <bits/stdc++.h> NEW_LINE #include <iostream> NEW_LINE using namespace std ; double innerCirclearea ( double radius ) { if ( radius < 0 ) { return -1 ; } double r = radius / 2 ; double Area = ( 3.14 * pow ( r , 2 ) ) ; return Area ; } int main ( ) { double radius = 4 ; cout << ( " Area ▁ of ▁ circle ▁ c2 ▁ = ▁ " , innerCirclearea ( radius ) ) ; return 0 ; }