Write a program for each 1,2 &3 1)given an integer variable n and a double varia
ID: 3642041 • Letter: W
Question
Write a program for each 1,2 &31)given an integer variable n and a double variable x, write code to compute x^n. (Assume both has positive numbers stored in them)
2)Repeat 1 but compute n!(n factorial is n*(n-1)*(n-2)*....*3*2*1).
3) use the solution to #2 to compute e^x rising this formulate e^x= 1+ x+x^2/2!+x^3/3!.....+x^n/n!
Write a loop that tests your solution and output the results for various values of n.(the solution is exactly correct when n is infinite and approach the correct value as the value of n increases).