#include <stdio.h>a
#include <conio.h>a
#include <iostream.h>a
float loge(float x)a
{
float y=(x-1)/(1+x);a
float ln1=0, ln2=2*y;a
float k=1;a
float p=y;a
while (k<10000)a
{
ln1 = ln2;a
k += 2;a
p = p * y * y;a
ln2 += 2 / k * p;a
}
return ln2;a
}
float log(int x, int k)a
{
return loge(x)/loge(k);a
}
void main()a
{
clrscr();a
int n,k;a
cout << "Logarithm of: ";a
cin >> n;a
cout << "Base of: ";a
cin >> k;a
cout << "\n" << log(n,k);a
getch();a
}
حرف اخر هر سطر جزوه برنامه نمی باشد.(a)