-
Help with my C homework
Hi guys, need help with my homework. It is neccesary to create a function double stepen(double x) that works as follows: every time the function is called with a given number x, it returns the next power of number x, so it returns x^1 for the first time, then x^2 , X^3, x^4, etc. However, when called with another number x, the power is reset to 1.
Use this function to create a function with the following prototype: void stepenuj_niz (double A [], int s [], int length) The function receives a series of real numbers A and a series of natural numbers s that are the same length, and then each member of series A is powered with the exponent given in the corresponding member of string s. You must use the first function in the second function.
-
You cannot simply post your assignment and wait for someone to do your homework for you. Give it a go yourself and then post the difficulties you encountered. How else do you think you are going to learn? Will you be taking Internet with you to the exam?
-
Remember static variables taught to you in class? No?
> corresponding member of string s
Don't you mean integer array s?
-
Wow, what a horrible function. Oh well, I guess you have to do what the teacher wants but hopefully your teacher also explains why it's silly to write stepen() to behave like that