Tuesday, 2 July 2013

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";
}

No comments:

Post a Comment