Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication2.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- #include <ctime>
- using namespace std;
- int main()
- {
- int array[10], pos;
- srand((unsigned)time(0));
- for (int i = 0; i<10; i++) {
- array[i] = (rand() % 200) + 1;
- cout << array[i] << "\t";
- }
- for (int i = 0; i<10; i++) {
- if (array[i] % 2 == 0) { pos = i + 1; break; }
- }
- cout << endl << "Pirmais para skaitlis atrodas " << pos << " pozicija." << endl;
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement