Hey, i need c++ coding to print sum of this series 1 + 1/11 + 1/21 + 1/31 + ... + 1/N
Would be great if someone could answer this quick, thanks.

Recommended Answers

All 4 Replies

Well if we use integer math then the answer would be

#include <iostream>

int main()
{
    std::cout << 1;
    std::cin.get();
    return 0;
}

Did you notice that the terms of your series consist of 1/(10*N + 1) and not 1/N ?

How do we do this programme:

1111
1111
1111
1111

Do you know how to write the digit 1 on a piece of paper or something?
Can you count to 4?
Instruct a computer to do the same.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.