Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- const int rows=3;
- const int cols=4;
- int sum(int arr[][cols],int );
- int main()
- {
- int SCORES[][cols]={{90,95,70,74},{65,87,93,62},{77,88,97,88}};
- sum(SCORES,2);
- }
- int sum(int SCORES[][cols],int ROWS)
- {
- int total=0;
- for(int i=0;i<ROWS;i++)
- {
- for(int j=0;j<cols;j++)
- {
- total=total+SCORES[i][j];
- }
- }
- cout<<total;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement