1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
yulyashka [42]
3 years ago
6

Consider the following code segment, where num is an integer variable.

Computers and Technology
1 answer:
posledela3 years ago
8 0

Answer:

Following are the complete code to the given question:

public class Main//main class

{

public static void main(String[] args) //main method

{

    int [][] arr = {{11, 13, 14 ,15},{12, 18, 17, 26},{13, 21, 26, 29},{14, 17, 22, 28}};//defining a 2D array

    int num=14;//defining an integer variable that holds a value 14

       for (int j = 0; j < arr.length; j++)//defining for loop to hold row value

       {

       for (int k = 0; k < arr[0].length; k++)//defining for loop to hold column value

       {

           if (arr[j][k] == num)//defining if block that checks num value

           {

               System.out.print(j + k + arr[j][k] + " ");//print value

           }

       }

       }

}

}

Output:

16 17

Explanation:

  • In the question, we use the "length" function that is used to finds the number of rows in the array.
  • In this, the array has the 4 rows when j=0 and k=2 it found the value and add with its index value that is 0+2+14= 16.
  • similarly when j=3 and k=0 then it found and adds the value which is equal to 3+0+14=17.
  • So, the output is "16,17".  
You might be interested in
A traffic signal system will only operate if it receives an output signal (D=1) This only can occur if: Either (a) signal A is R
kozerog [31]

Answer:

0

Explanation:

4 0
3 years ago
Write a program code which asks for 80 numbers between 100 and 1000 to be entered.
valentina_108 [34]

Answer:

my hearth start with a piece of demon cant let me go!

7 0
3 years ago
Whatisthebestlocationapp for my androidphonebesidesgoogle maps?
Cerrena [4.2K]
Not sure whether this question is requires a specific answer but I would say Waze.
3 0
4 years ago
In some employment situations, not all personnel can immediately evacuate a work area per the eap. it may be that some equipment
Anika [276]
I think the correct answer from the choices listed above is option A. These personnel are referred to as critical personnel. They are em<span>ployees who may remain to shut down critical operations before evacuating. Hope this answers the question. Have a nice day.</span>
8 0
4 years ago
How many generations of computer languages
vichka [17]
5 generations................
6 0
3 years ago
Other questions:
  • When you reboot your system, the computer follows start-up instructions stored in this type of memory. multiple choice dram sdra
    15·2 answers
  • I want to message someone on Brainly but it wont let me. How many questions do I need to answer before I could message?
    12·2 answers
  • Packet ________ is a form of protection for your computer that looks at each packet that comes into your computer network. scree
    15·1 answer
  • How can a Word user insert a page break into a document to isolate a table on a new page?
    13·2 answers
  • Which device uses radio waves? ceiling fan microwave oven air conditioner x-ray machine?
    7·1 answer
  • If you uncheck the option to "Replace text as you type," what will occur?
    5·2 answers
  • If the code for JAVA is LCXC, what is the code for BASIC?
    12·1 answer
  • Logan has developed an excellent presentation with interesting content. He received great feedback on the evaluation
    10·1 answer
  • 4.1 code practice python
    13·1 answer
  • Does anyone know how to permanently delete photos on a dell computer? For my cousin.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!