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";
}
#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
Post a Comment