Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <time.h>
- using namespace std;
- const int n=10;
- int main()
- {
- float a[n];
- for (int i=0; i<n; i++){
- a[i] = rand() %100 + 1;
- cout << a[i] << " ";
- }
- cout <<endl;
- for (int i=0; i<n; i++){
- if (i%2==1){
- cout << a[i] << " ";
- }
- }
- cout <<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment