Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- #include <stdlib.h>
- using namespace std;
- int n = 10;
- int i;
- int main()
- {
- int tab[n];
- srand(time(0));
- cout<<"STARA TABLICA ";
- for(i = 0; i <= n; i++)
- {
- tab[i]=rand()%500;
- cout<<tab[i]<<", ";
- }
- cout<<"\nNOWA TABLICA ";
- for(i = 0; i <= n; i++)
- {
- if(i%2!=0)
- {
- tab[i]=0;
- }
- cout<<tab[i]<<", ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement