- English
- فارسی
11
#include<iostream.h> #include<math.h> void main () { double x; double jomleh; // baraaye inke... double chandJomleyi=0; int tedadJomleh, i=1; cout << "x="; cin >> x; cout << "taa chand jomle?"; cin >> tedadJomleh; chandJomleyi = jomleh = x; i = 2; while (i<2*tedadJomleh+1) { jomleh *= -1 * x * x / (i*(i+1)); chandJomleyi += jomleh; i+=2; } cout << "meghdare tabe'= " << chandJomleyi << endl; }