❓ Help Pa help po.. paano kaya to idisplay yung mga highlighted na number

Status
Not open for further replies.
Try using 'continue;' to skip specific element from array. Gawa ka condition sa loob ng for loop ng
if (i ==0 || i == 3){
If (j==1 || j == 4){
continue;
}
}

Di ko sure kung magwork to wala akong gamit na pc pero sana nagkaron ka idea.
 
Try using 'continue;' to skip specific element from array. Gawa ka condition sa loob ng for loop ng
if (i ==0 || i == 3){
If (j==1 || j == 4){
continue;
}
}

Di ko sure kung magwork to wala akong gamit na pc pero sana nagkaron ka idea.
thank you po sir.. gayahin ko to sir. ginawa mo
 
c++ Code:
C++:
#include <iostream>
using namespace std;

int main()
{
int arr[4][4] = {{10, 20, 30, 40},
                 {11, 21, 31, 41},
                 {50, 60, 70, 80},
                 {51, 61, 71, 81}
};
for(int i = 0; i < 4; i++){
    if(i== 0 || i == 3)
    cout<<arr[i][1]<<" "<<arr[i][2];
    else
    cout<<arr[i][0]<<" "<<arr[i][3];
    cout<<endl;
    }
    return 0;
}
 
c++ Code:
C++:
#include <iostream>
using namespace std;

int main()
{
int arr[4][4] = {{10, 20, 30, 40},
                 {11, 21, 31, 41},
                 {50, 60, 70, 80},
                 {51, 61, 71, 81}
};
for(int i = 0; i < 4; i++){
    if(i== 0 || i == 3)
    cout<<arr[i][1]<<" "<<arr[i][2];
    else
    cout<<arr[i][0]<<" "<<arr[i][3];
    cout<<endl;
    }
    return 0;
}
wow .. galing mo naman sir.
 
Status
Not open for further replies.

About this Thread

  • 7
    Replies
  • 280
    Views
  • 3
    Participants
Last reply from:
EEEEERRRRRAAAA

Trending Topics

Online now

Members online
969
Guests online
1,497
Total visitors
2,466

Forum statistics

Threads
2,294,900
Posts
29,093,855
Members
1,206,605
Latest member
kyferfer
Back
Top