Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a[4][4], i, j,q1=0,q3=0;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- cin >> a[i][j];
- }
- }
- for (i = 0; i < 2; i++) {
- for (j = 0; j < 2; j++) {
- q1 += a[i][j];
- q3 += a[i+2][j];
- }
- }
- cout << "q1 = " << q1 << endl << "q3 = " << q3 << endl;
- float av;
- av = q1 / 4;
- cout << "The av of First quarter : " << av << endl;
- av = q3 / 4;
- cout << "The av of Third quarter : " << av << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment