Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main()
- {
- int n;
- cout << "Napisz wielkosc tablicy n= " << n << endl;
- int tab[n];
- for (int i = 0; i < n; i++)
- {
- cout << "tab[" << i << "] = ";
- cin >> tab[i];
- }
- for (int i = 0; i < n; i++)
- {
- cout << "tab[" << i << "] = " << tab[i] << endl;
- }
- cout << "Liczby parzyste sa w tablicy o indeksach:" << endl;
- for (int i = 0; i < n; i++)
- {
- if (tab[i]%2==0)
- {
- cout << "tab[" << i << "], " << endl;
- }
- }
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment