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

Status
Not open for further replies.

EEEEERRRRRAAAA

Honorary Poster
using array pa help po
1624198142429.webp
1624198169387.webp
 
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
  • 275
    Views
  • 3
    Participants
Last reply from:
EEEEERRRRRAAAA

Trending Topics

Online now

Members online
1,043
Guests online
922
Total visitors
1,965

Forum statistics

Threads
2,274,911
Posts
28,959,286
Members
1,233,484
Latest member
asawakoo03
Back
Top