Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<ctime>
- int main() {
- srand(time(NULL));
- int arr[6],res=1;
- for (int i = 0; i < 6; i++) {
- arr[i] = rand() % 5;
- std::cout << arr[i] << " ";
- }
- for (int i = 0; i < 6; i += 2) {
- if(arr[i])
- res *= arr[i];
- }
- std::cout <<'\n'<< res << std::endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement