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
Mnenie [13.5K]
3 years ago
11

Given a MxN matrix.Print the elements in odd rows from left to right and the elements in even rows from right to left.(Java or C

++)
Computers and Technology
1 answer:
ludmilkaskok [199]3 years ago
7 0

given the array arr[][]:

 bool leftToRight = true;

 for (int i=0; i<M; i++)

   {

       if (leftToRight)

       {

           for (int j=0; j<N; j++)

               printf("%d ", arr[i][j]);

       }

       else

       {

           for (int j=N-1; j>=0; j--)

               printf("%d ",arr[i][j]);

       }

 

       leftToRight = !leftToRight;

   }

You might be interested in
There’s No Difference In Security If You Use A Public PC Or Your Own Computer.
Andreas93 [3]
False because if you use public someone else could be using it as a a trap to get your information and with your own if you no how to use it well you will be safe


3 0
4 years ago
6. What is the difference between portrait and landscape orientation? What are the advantages of
vlabodo [156]

Answer:

PORTRAIT ORIENTATION IS VERTICAL AND LANDSCAPE ORIENTATION IS HORIZONTAL

Explanation:

PORTRAIT SETTING CAN BE USED TO DESCRIBE MEANINGS OF LETTERS IN A WORD LANDSCAPE CAN BE USED TO DIFFERENTIATE  BETWEEN WORDS MEANINGS                                                                                                                                            

3 0
3 years ago
Why should you delete files from your computer
notka56 [123]

deleting files can free up space and prevent hackers from accessing your sensitive files

5 0
2 years ago
Read 2 more answers
What is the purpose of anti-bullying laws
nasty-shy [4]
The purpose of anti-bullying laws is so that people aren’t getting bullied because when someone gets bullied it could cause them to become depressed and not happy on who they are
6 0
3 years ago
Read 2 more answers
Does anyone know what the name of the game is, where you click on the grey dots in a 3x3 grid and try to make them all the same
antoniya [11.8K]

Answer:

Its the pattern puzzle game.

Explanation:

The answer is straight forward. Its a pattern puzzle game, and here we need to change everything to same color, and that is a pattern of this pattern game. Many forms of such pattern games are available, but this one happens to be the most popular among them all, and is widely used by various people of all ages to pass their time.

3 0
3 years ago
Other questions:
  • The responsibilities of the IT department and the needs of the user departments may cause conflicts over A. the color of the use
    6·1 answer
  • Write a repetition statement that outputs the numbers 45 , 51 , . . . , 165 . That is, all of the multiples of 6 in increasing o
    7·1 answer
  • Do most good businesses have to deal with conflict
    7·1 answer
  • To save a file so that it can be opened on most computers, select the ____ option.
    10·2 answers
  • In mathematics, the square root of a negative number is not real; in Java therefore, passing such a value to the square root fun
    12·1 answer
  • Obtaining the data of a video file from a flash drive is an example of a(n) _________ operation.
    6·1 answer
  • You must signal ___ before any turn or lance change ?
    9·2 answers
  • Which is the purpose of adding B-Roll footage to a sequence?
    10·1 answer
  • Write a 10 sentence paragraph about george washington and abraham lincoln and no plagiarism
    8·2 answers
  • I am writing a Python code to ask a user to enter students' information including name,
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!