Почему при результате s= выводится inf ?????

Где здесь ошибка подскажите?????

#include

using namespace std;

int main()

{

int n;

float s = 0;

int i;

cout<<"n = "; cin>>n;

for (i = 1; i<=n; i++)

{

s = s+ 1.0/((i-1)*(i+1));

}

cout<<"s = "<< s ;
return 0;

}
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.