Hi, I am

Ngô Tôn

I am a programmer.

Home / Programming / C/C++ / Tính e mũ x

Tính e mũ x

Yêu cầu:

Nhập 1 số c > 0 (sai số) và 1 số thực x rồi tính : e^x = 1 + x/1! + x^2/2! + …+x^n/n!
Tổng được tính với n đủ lớn sao cho |x^n/n!| < c thỏa mãn.

Thuật toán:

– Tương tự như tính sinx, cosx, chúng ta sử dụng vòng lặp for() để giải quyết bài toán này.

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 …

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
ngocson Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
ngocson
Guest

kkk