Print and calculate the following series 1/1 + 2/3 + 3/5 + 4/7.........+19/27

#include<iostream>
using namespace std;
void main()
{



float deno = 1;
float sum = 0;

for(float num = 1; num<= 19 ; num=num+1 )
{
cout<<num<< "/" <<deno<<" + " ;
deno = deno + 2;
sum = sum + (num/deno);
}
cout<< "Sum of series = " << sum <<endl;
}

Comments

Popular posts from this blog

Umbrella activities in Software Engineering

Operating System | Best Definition of Opetating System