Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //array problem 4
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n,av,sum=0;
- cin >> n;
- int ar[n];
- for(int i=0; i<n; i++)
- {
- cin >> ar[i];
- sum+=ar[i];
- }
- cout << "average of the array elements are " << sum/n << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement