Simple example how to use library functions

Simple example how to use library functions

#include <iostream.h>
#include <math.h>
#include <conio.h>
void main( )
{
float f,l,c;
const float PI=3.14;
clrscr();
cout<<”Enter values of l and c \n”;
cin>>l>>c;
f = 1/(2 * PI * sqrt(l * c) );
cout<<”f = “<<f<<”\n”;
getch();
}
Output :
Enter values of l and c
11.4 0.5
f = 0.0666

0 comments: