Guest User

Untitled

a guest
Feb 17th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4. int main()
  5. {
  6.  
  7. int n;
  8.  
  9. cout << "Napisz wielkosc tablicy n= " << n << endl;
  10. int tab[n];
  11.  
  12. for (int i = 0; i < n; i++)
  13. {
  14. cout << "tab[" << i << "] = ";
  15. cin >> tab[i];
  16. }
  17.  
  18. for (int i = 0; i < n; i++)
  19. {
  20. cout << "tab[" << i << "] = " << tab[i] << endl;
  21. }
  22.  
  23. cout << "Liczby parzyste sa w tablicy o indeksach:" << endl;
  24. for (int i = 0; i < n; i++)
  25. {
  26.     if (tab[i]%2==0)
  27.     {
  28.         cout << "tab[" << i << "], " << endl;
  29.     }
  30. }
  31.  
  32. getchar();
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment