Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Rus");
- int N;
- cout << "Введите число элементов " << endl;
- cin >> N;
- int* a = new int[N];
- cout << "Введите элементы массива .Выведите четные элементы массива " << endl;
- for (int i = 0; i < N; i++)
- {
- cin >> a[i];
- }
- for (int i = 0; i < N; i++)
- {
- if (a[i] % 2 == 0)
- {
- cout << "Номер индекса " << i << " ";
- cout << "А сами четные элементы " << a[i] << " " << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement