Write a program to show the concept of Inline Function in C++

#include<iostream.h>
#include<conio.h>
inline float area(float r)
{
    return(3.14*r*r);
}
void main()
{
    float radius, a ;
    cout<<"enter the radius of circle:";
    cin>>radius;
    a=area(radius);
    cout<<"the area of circle="<<a<<"\n";
}

Comments

Popular posts from this blog

Write a program to add two number using inline function in C++?

Traversing of elements program with algorithm and Flowchart