write a program that displays the following series using do ....while loop 1+1/4.....+1/100
#include <iostream>
using namespace std;
int main()
{
float c,r;
c=4.0;
r=1.0;
do
{
r=r+1.0/c;
c=c+4;
}
while(c<=100);
cout<<"result"<<r;
return 0;
}
No comments:
Post a Comment