Skip to content

Instantly share code, notes, and snippets.

@Sanokei
Created November 12, 2021 01:07
Show Gist options
  • Save Sanokei/013d5d20c49158d2ace7ba3294d01193 to your computer and use it in GitHub Desktop.
Save Sanokei/013d5d20c49158d2ace7ba3294d01193 to your computer and use it in GitHub Desktop.
int main(){
int table[5][6];
int sum = 0;
for(int i = 0; i < 5; i++){
for(int j = 0; j < 6; j++){
cout << "Enter the number: ";
cin >> table[i][j];
}
}
for(int i = 0; i < 5; i++){
for(int j = 0; j < 6; j++){
if(table[i][j] % 2 == 0){
sum += table[i][j];
}
}
}
cout << "The sum of all even numbers is: " << sum << endl;
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment