Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void Input(int arr[], int n)
- {
- cout << "\tenter array\n";
- for (int i = 0; i < n; i++)
- {
- cin >> arr[i];
- }
- }
- void Output(int arr[], int n)
- {
- int sum = 1;
- for (int i = 0; i < n; i++)
- {
- int r = arr[i];
- int k = i;
- if (!((i + 1) % 3))
- {
- sum = sum*r;
- }
- }
- cout << "\n\tsum is:\n" << sum << endl;
- }
- int main()
- {
- int n;
- cout << "\tEnter n:\n";
- cin >> n;
- int m;
- cout << "\tEnter n2:\n";
- cin >> m;
- int a[255];
- int b[255];
- cout << "\tArray 1:\n";
- Input(a, n);
- cout << "\tArray 2:\n";
- Input(b, m);
- cout << "\tElements of array 1 is: \n";
- Output(a, n);
- cout << "\tElements of array 2 is: \n";
- Output(b, m);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement