I am trying to fiqure out this problem for a long time. I am teaching myself C++ from C++ for Dummies and I cant figure this out.


Fill in a 2 dimension 3x3 array with odd numbers. The display shows the array as it is being filled. Use random integers to fill the array. Use numbers between 1 and 10. Initialize array to zero. Find the sum of matrix. Find the maximum number in the matrix and the number of times it occurred. Can anyone show me a code that does this?

Recommended Answers

All 8 Replies

does anyone know how to do it

Member Avatar for iamthwee

Yes, I know how to do this.

Yes, I know how to do this.

can you write it

OK, you've listed a handful of different things your program is supposed to do.

Can you do ANY of them, at all?

Show us how far you've got and a specific question about what to do next, don't just post "gimme the answer" then bump it with a useless "does anyone know".

void BuildRndList( unsigned array[], const unsigned size,
const unsigned OtherIDs, const unsigned OtherIDamt ){


if (seeded == false) RNDseed();
// set array to all '0'
for ( unsigned i = 0; i < size; i++ ) array = 0;
for ( unsigned i = 1; i <= OtherIDs; i++) {
for (unsigned j = 0; j < OtherIDamt; j++) {
bool loop = true;
do{
const unsigned RNDnum = RNDgen(size);
if ( array[RNDnum] == 0 ) {
array[RNDnum] = i;
loop = false;
}

int i,k=0,j;
int a[3];
int b[3];
int c[6];
bool flag;
//cout<<

commented: Don't bump old threads -1

Whoops, necro thread >.<

This thread is nearly three years old, just saying.

int i,k=0,j;
int a[3];
int b[3];
int c[6];
bool flag;
//cout<<

Uh? Sometimes I just don't get what people are thinking...

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.