A quantum algorithm for the calculation of (\pi) is proposed and implemented on the five-qubit IBM quantum computer with superconducting qubits. We find (\pi=3.157\pm0.017). The error is due to the noise of quantum one-qubit operations and measurements. The results can be used for estimating the errors of the quantum computer and suggest that the errors are purely random.