My code is not showing exact float value means number after point is not displayed by the code I am using Turbo C for sum up the series 1 + 1/3 + 1/5 + 1/7 + 1/9+….. Up to N terms
#include<iostream.h>
#include<conio.h>
void main()
{
int k=0;
int m=0;
int s=1;
clrscr();
cout<<"Enter the limit of the series: ";
cin>>m;
for(int j=1;j<=m;j=j+2)
{
m=1/j;
s+=m;
}
cout<<"Sum of the given series is: "<<s;
getch();
}