#include<iostream.h>
#include<conio.h>
#include<math.h>
float suma(float x, float y);
float roznica (float x, float y);
float mnozenie (float x, float y);
float dzielenie (float x, float y);
float potegowanie (float x, float y);
float pierwiastkowanie (float x);
float logarytm_naturalny (float x);
float logarytm_dziesietny (float x);
void main()
{
float x,y;
clrscr();
cout<<"Podaj wartosc x: ";
cin>>x;
cout<<"Podaj wartosc y: ";
cin>>y;
cout<<"Dodawanie (x+y): "<<suma(x,y)<<endl;
cout<<"Mnozenie (x*y): "<<mnozenie(x,y)<<endl;
cout<<"Roznica (x-y): "<<roznica(x,y)<<endl;
cout<<"Dzielenie (x/y): "<<dzielenie(x,y)<<endl;
cout<<"Potegowanie (x^y): "<<potegowanie(x,y)<<endl;
cout<<"Pierwiastek z x : "<<pierwiastkowanie(x)<<endl;
cout<<"Logarytm naturalny z x : "<<logarytm_naturalny(x)<<endl;
cout<<"Logarytm naturalny z y : "<<logarytm_naturalny(y)<<endl;
cout<<"Logarytm dziesietny z x : "<<logarytm_dziesietny(x)<<endl;
cout<<"Logarytm dziesietny z y : "<<logarytm_dziesietny(y)<<endl;
getch();
}
float suma(float x,float y)
{
return(x+y);
}
float mnozenie(float x,float y)
{
return(x*y);
}
float roznica(float x,float y)
{
return(x-y);
}
float dzielenie(float x,float y)
{
return(x/y);
}
float potegowanie(float x,float y)
{
float potega=1;
for(float i;i<y;i++)
{
potega=potega*x;
}
return(potega);
}
float pierwiastkowanie(float x)
{
return(sqrt(x));
}
float logarytm_naturalny(float x)
{
return(log(x));
}
float logarytm_dziesietny(float x)
{
return(log10(x));
}