Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
779 B
2
Indexable
Never
 #include<iostream> //iostream is the header file which is being used to excute this program
 
 using namespace std; //using namespace cuz we dint have to use std bar bar
 
 //using inline function so that it wil be copied at the moment/point when its being called
 inline float circle_area(float radius)
{
 return (3.14*radius*radius); // calculating the area after taking radius as a function parameter
}

int main()
{
float radius; // taking space 8 bit not using int datattype cux area cn be in decimal value

cout<<"Enter radius : "; //saying user what to input

cin>>radius; //storing the value to the variable "radius"

cout<<"Circle_area = "<<circle_area(radius); //calling the area function to calculate the area and return the area

return 0;
}