i am writing a program that is delcaring an array of 100 intger numbers
and filling the array with random numbers us rand(). all i have so far is.


#include <iostream>

using namespace std;

int main()
{
int random_integer = rand();

Good start.

What's your question?

where do i declare 100 in the program

You would declare the array in main( ) (assuming this is just a simple program). It should follow the opening { of main.

Then declare the variable to count through the loop that you will use to fill the array, then start the loop, using that counter as the array index.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.