hello there.

i have a two dimensional vector.

int numbers[][]=new int[5][4];

i want to find if elements of row numbers[1] are equal to elements of row numbers[2];

i wrotted this code;

for(int i=0;i<5;i++){

for(int j=0;j<4;j++){

if(numbers*[j]==numbers[(i+1)][j]{
System.out.print(numbers [j]);
}
}
}*

## Recommended Answers

Jump to Posti want to find if elements of row numbers[1] are equal to elements of row numbers[2];

Are you to test if all are equal or only some? For example: 1,2,3 equals 1,2,3 but does not equal 1,4,3

what about: 1,2,3 and 3,1,2?What will the results of the compare …

Jump to PostHow would you do it if you were to do it by hand?

If you start at the first element in the first row, what would you compare it to first?

Then what would you compare it to next and so on and so on until you had compared it …

Jump to PostDo you have the pattern for how to compare an element from the array with the contents of the rest of the elements in the array?

Can you list the steps in pseudo code to describe how it is to be done.A simple example:

loop through all elements …

Jump to PostYou need to design the program and how it is to work BEFORE writing the code.

Do you have a design for how the program is supposed to work?

Please post it.

When the logic is worked out, then write the code.array out of index at: if(nr

[j]==nr[i++][j])One of …

## All 14 Replies

NormR1
563
Posting Sage
Team Colleague

ndrichim
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

ndrichim
0
Newbie Poster

ndrichim
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

ndrichim
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

ndrichim
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

ndrichim
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

ndrichim
0
Newbie Poster

NormR1
563
Posting Sage
Team Colleague

Be a part of the DaniWeb community

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