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
The term BIOS stands for
iren2701 [21]
Basic Input-Output System
8 0
3 years ago
The _______ has shortcuts to commonly used commands.        A. ScreenTip   B. Status bar   C. File tab   D. Quick Access toolbar
Helen [10]

Answer is D. Quick Access toolbar


4 0
3 years ago
Read 2 more answers
A Von Neumann model for a computer system has a central processing unit (CPU) that makes
sammy [17]

Answer:

1. Calculation unit

2. control unit

3. storage

Explanation:

4 0
3 years ago
#include
Ivanshal [37]

Answer:

dang sis did u really have to but all of that

3 0
4 years ago
Where do you access to header section in excel?​
Sergeeva-Olga [200]

Answer:

On the Insert tab, in the Text group, click Header & Footer. Excel displays the worksheet in Page Layout view. Click the left, center, or right header or footer text box at the top or the bottom of the worksheet page.

Explanation:

6 0
3 years ago
Other questions:
  • 5255555555555+55555555555555/1111*99442
    14·2 answers
  • Find 5 rational numbers between -1 and 1​
    8·1 answer
  • What determines the choice of a rocket for a mission?
    11·1 answer
  • Determine if x(t) is periodic and determine the fundamental period.
    15·1 answer
  • What considerations should you make when deciding on the size of a table?
    9·1 answer
  • In the Microsoft Office Suite, what tells a database what to insert information in the document? 
    8·1 answer
  • What is the best way to show a complex data chart in word?
    6·1 answer
  • Select three advantages of cloud computing.
    10·1 answer
  • Give 3 reasons why it is believed that smart phones precent us from communicating face to face.give three reasons why it is beli
    8·1 answer
  • Using an open connection to a small company's network, an attacker submitted arbitrary queries on port 389 to the domain control
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!