Thread: Declaring and initializing a 3000 number array?

  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    13

    Declaring and initializing a 3000 number array?

    Here are the steps to this program:

    1. Declare an array that will hold 3000 numbers
    2. Initialize this array by assigning a random number to each element in the array
    3. Traverse the array, modifying the current contents of each element in the array so that each value now lies between -3000 and 3000 inclusive
    4. Traverse the array to compute the average value of all elements

    I have never worked with arrays before and am lost!

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,509
    Well, you need to learn arrays before you can start solving this problem. Were they covered in class? If so, refer to your notes and practice using some simple arrays. If not, refer to your book/a tutorial and practice using some simple arrays. After that, you can begin to build up your program bit by bit, and we'll be better able to help.

  3. #3
    Registered User
    Join Date
    Oct 2013
    Posts
    12
    There's a lot online about arrays. Like said above, I would start by learning how arrays work. Then go from there

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. declaring a decimal number in c
    By smitect in forum C Programming
    Replies: 2
    Last Post: 12-06-2012, 05:45 PM
  2. Initializing and declaring arrays in classes
    By edishuman in forum C++ Programming
    Replies: 2
    Last Post: 01-23-2012, 07:58 PM
  3. Replies: 1
    Last Post: 03-17-2005, 08:53 AM
  4. Declaring an variable number of variables
    By Decrypt in forum C++ Programming
    Replies: 8
    Last Post: 02-27-2005, 04:46 PM
  5. random numbers between 1500 and 3000
    By jamie85 in forum C Programming
    Replies: 3
    Last Post: 02-21-2005, 01:28 PM

Tags for this Thread