Skip to content

Instantly share code, notes, and snippets.

@Sanokei
Created November 12, 2021 01:09
Show Gist options
  • Save Sanokei/68f3db459b572f8cabb253aaa67ecef3 to your computer and use it in GitHub Desktop.
Save Sanokei/68f3db459b572f8cabb253aaa67ecef3 to your computer and use it in GitHub Desktop.
int main(){
int table[6][6];
int row, col;
int odd_count = 0;
for (row = 0; row < 6; row++){
for (col = 0; col < 6; col++){
cout << "Enter a number: ";
cin >> table[row][col];
}
}
for (row = 0; row < 6; row++){
for (col = 0; col < 6; col++){
if (table[row][col] % 2 != 0){
odd_count++;
}
}
cout << "There are " << odd_count << " odd numbers in row " << row << endl;
odd_count = 0;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment