Hi, I am

Ngô Tôn

I am a programmer.

Home / Programming / C/C++ / Tính hằng số PI = 3.14

Tính hằng số PI = 3.14

Yêu cầu:

Tính PI với sai số 0.0001 theo công thức: PI/4 = 1 – 1/3 + 1/5 – 1/7 +…

Thuật toán:

– Dùng vòng lặp for().

– PI/4 = ∑(1 + ((-1)n/(2n+1)))

Code:

Kết quả:

About ngoton

Ngô Tôn is a programmer with passion for tailored software solutions. Comes with 7+ years of IT experience, to execute beautiful front-end experiences with secure and robust back-end solutions.

Check Also

Xây dựng hàm bạn để tính diện tích hình chữ nhật

Yêu cầu: Xây dựng hàm bạn để tính diện tích hình chữ nhật Code: Giải …

Leave a Reply

avatar
  Subscribe  
Notify of