Thread: Inserting several elements in array

  1. #1
    Registered User
    Join Date
    Jul 2020
    Posts
    1

    Inserting several elements in array

    Guys, could anyone help me solve this task:
    "Create program which contains function
    'increaseANDexpand' that expands array of integers for new element which is added after every odd number in array. New element which is inserted has 3 times the value of the odd number after which it is inserted. Ex. if odd number from array is 3 insert 9 after him, if odd number from array is 5 insert 15 after him etc.. I spend a lot of time trying to solve this, and this will be the task I will get to solve on test on my university. If someone can write code here, I would greatly appreciate )

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    733
    If someone can write code here, I would greatly appreciate.
    We cannot and do not write your code for you especially for a homework assignment, or a test.

    You need to write a first attempt, and post the code here if you have problems or questions.

    The instructions are a little vague. You should look at functions such as malloc(), and realloc() to allocate and expand the array, especially if the number of initial elements of the array is not known at the start of the program.

    Please read the FAQ at the top of the page in this forum.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inserting into array
    By nevx in forum C Programming
    Replies: 9
    Last Post: 07-10-2020, 02:40 AM
  2. inserting values in an array
    By fairyjerry14 in forum C Programming
    Replies: 1
    Last Post: 10-12-2007, 01:15 AM
  3. inserting an element into an array
    By galmca in forum C Programming
    Replies: 14
    Last Post: 01-09-2005, 06:34 AM
  4. Inserting elements into array
    By sean in forum C++ Programming
    Replies: 4
    Last Post: 07-07-2003, 04:56 PM
  5. Inserting words into an array
    By Rizage in forum C++ Programming
    Replies: 8
    Last Post: 10-18-2002, 03:29 AM

Tags for this Thread