I’ve been asked to create this for loop for my C Programming class but I do not know how to alternate the positive and negative values. Thank you in advance!
sum2=1-x+x^2-x^3+⋯+/-x^n
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hint: consider the expression as sum of (-1*x)^i, with i = 1, 2, 3, …, n.
If n is even then (-1*x)^i is positive, if odd then negative.