0

Display the result of 1/1! - 1/2! +1/3! -..... By c programming

someone pls post a solution

21st Feb 2017, 5:38 PM
Adnan
1 Answer
0
idk about c but you could translate it. and if you have 1/8, just as integers.... u gunna get 0 for everything.... double fac(int f){ if(f == 1) return 1; else return f*fac (f-1); } double a = 1.0, sum = 0.0; for(int x = 1; x < n; x++){ if (x%2 ==0) sum -= (a/fac(x)); else sum += (a/fac(x)); } hope this helps!!
26th Feb 2017, 5:40 PM
Michael Szczepanski
Michael Szczepanski - avatar