Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 Re: Computer Math » Calculating Pi » 2018-07-29 14:43:59


Will using this formula in the code have a lesser complexity than the code originally posted?

\pi = 4 \sum_{k \geq 0} (-1)^k {1\over 2k + 1}

#2 Re: Computer Math » Calculating Pi » 2018-07-26 01:25:15

George,Y wrote:

If both of them succeeded,  the mistake is located in main

I do not get your point, can you please explain it?

#3 Re: Computer Math » Calculating Pi » 2018-07-17 15:46:16

hi Benice;

Thanks for pointing out that the sone and stwo's would have been floats.

hi Agnishom;

That was not intentional. Thanks for pointing out.

However, can anyone please explain why the code was not working properly when I entered the datatype of sone and stwo as "int"?

#4 Re: Help Me ! » Letter-arranging » 2018-07-02 15:40:09

Can you please tell how the code will be looking?

#5 Re: Coder's Corner » Calculating Complexity in C++ » 2018-07-02 15:38:32

Yes. The run time or the execution time.

#6 Re: Computer Math » Calculating Pi » 2018-06-10 14:56:14

hi bob bundy;

For "not working properly", I mean that the program is getting frozen and not printing anything at all.
Can you please point out my code for bugs?

#7 Coder's Corner » Calculating Complexity in C++ » 2018-06-09 18:50:07

Replies: 2


How to calculate the number of steps carried out in C++ directly?

#8 Coder's Corner » String Permutations » 2018-06-09 18:48:12

Replies: 1


Is it possible rearrange the words in a string in every possible way. If yes, how to do it?

#9 Computer Math » Calculating Pi » 2018-06-09 18:13:36

Replies: 9


I have written a code in C++ for calculating the approximate value of

based on the formula:

#include <iostream>

double CalculatePi(int acc)
    int sone;
    int stwo;
    double pione = 0;
    double pitwo = 0;
    for (sone = 1; sone < acc; sone += 4) {
        pione = pione + 1/sone;
    for (stwo = 3; stwo < acc; sone += 4) {
        pitwo = pitwo - 1/stwo;
    double potentialpi;
    potentialpi = pione + pitwo;
    std::cout << potentialpi * 4 << std::endl;
    return 0;

int main()
    std::cout << "Enter accuracy: ";
    int accuracy;
    std::cin >> accuracy;
    return 0;

However, this code is not working properly and is not returning anything when I am inputting "acc"(for accuracy) more than 2.
Can anyone please help me out here?

#10 Help Me ! » Letter-arranging » 2018-06-09 17:51:30

Replies: 3


Can anyone please provide a detailed solution for this problem?

All the letters of the word 'EAMCOT' are arranged in different possible ways. Find the number of arrangements in which no two vowels are adjacent to each other

Is there any program for solving this? If yes, please provide the code.

#11 Re: Help Me ! » Monomial, Binomial, Trinomial or none of these? » 2016-05-01 13:37:30


Do we count only the unlike terms and state them only as terms?

#12 Re: Help Me ! » Monomial, Binomial, Trinomial or none of these? » 2016-05-01 03:06:25


See this algebraic expression:

4x +9x
It is a binomial.

When it is written 13x, it is a monomial.

Then what type of expression is this?

#13 Re: Coder's Corner » Numbers » 2016-04-29 16:20:05

Hi bobbym;

In my book of Computer Science(Now I am in 7th Grade), the Russian method is taught, i think it is quite easier.

#14 Re: Coder's Corner » Coding » 2016-03-06 22:20:15


I am new to coding and I did not understand the meaning of module.

#15 Re: Coder's Corner » new to coding » 2016-03-05 22:44:00


What is a module in programming?

#16 Help Me ! » Monomial, Binomial, Trinomial or none of these? » 2016-02-27 16:52:03

Replies: 7


See the following algebraic expression:

1/3(x + y + z)

It can be also written as: x/3 + y/3 + z/3
Or: (x + y + z)/3

Is this a monomial, binomial, trinomial or none of these?

#17 Re: Dark Discussions at Cafe Infinity » Geometrical Progression » 2015-03-05 14:41:09


This story was written by an Indian poet and writer Sukumar Ray. He lived in West Bengal.

#18 Re: Introductions » Hello World » 2015-01-18 16:46:27


Today is my math exam also!

#19 Re: Science HQ » Theory of Curveness » 2015-01-18 16:43:49

Amartyanil wrote:


All things on a planet or a sattelite, that we see straight are actually curved and the things that we see curved are actually straight!

I have corrected it:

All things on any spherical celestial bodies that we see straight are curved and I am not sure about curved things.

#21 Jokes » Nasiruddin's T-Shirt » 2015-01-14 15:12:53

Replies: 1

Once, there was three marriage invitations with Mullah Nasiruddin and his friend.

The friend had no good shirts and he borrowed a T-Shirt from Mullah Nasiruddin.

On the first invitation, Nasiruddin said to the people, "The T-Shirt my friend is wearing is mine." On the way home, Nasiruddin's friend scolded him for saying those things which Nasiruddin said.

Next day, on the second invitation, Nasiruddin said to the people, "The T-Shirt my friend is wearing is not mine." On the way home, Nasiruddin's friend advised him for not giving any information(neither true nor false).

Next day, on the third invitation, Nasiruddin said to the people, "I will not give any information about the T-Shirt my friend is wearing!"

#23 Jokes » Ship » 2014-12-17 15:24:53

Replies: 9

A ship was going to sink. One swimmer said to the captain,"How much far is the land?"
Captain said,"Two kilometers."
Swimmer said,"In which direction?"
Captain said,"In the down."

#24 Re: Science HQ » Mars » 2013-10-03 21:00:03

bobbym wrote:

It looks like Mars(the red or orange area), but it is Earth. Because grass is here.

#25 Re: Science HQ » Mars » 2013-09-24 18:01:02


In Bengali, "Tuesday" is called "Mangal Baar"("Baar" means day in Bengali). And "Mangal" means Mars.
And similarly "Tues" is called Mars?

Board footer

Powered by FluxBB