Thread: Help with my C homework

  1. #1
    Registered User
    Join Date
    Dec 2019
    Posts
    1

    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.

  2. #2
    Registered User Ivory348's Avatar
    Join Date
    Oct 2019
    Posts
    75
    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?

  3. #3
    Registered User
    Join Date
    Aug 2019
    Location
    inside a singularity
    Posts
    308
    Remember static variables taught to you in class? No?

    > corresponding member of string s

    Don't you mean integer array s?
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook, The Wizardry Compiled

  4. #4
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,787
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Homework help
    By newbwithC++ in forum C++ Programming
    Replies: 5
    Last Post: 02-16-2011, 04:21 PM
  2. help about homework
    By agathery in forum C Programming
    Replies: 27
    Last Post: 05-19-2010, 09:17 PM
  3. Homework Help!!
    By Jdub in forum C Programming
    Replies: 10
    Last Post: 04-24-2010, 02:39 AM
  4. A little homework help?
    By nwkegan in forum C++ Programming
    Replies: 11
    Last Post: 03-07-2010, 09:45 AM
  5. Help on homework?
    By De1337eD in forum C# Programming
    Replies: 1
    Last Post: 02-21-2010, 06:49 PM

Tags for this Thread