Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 06 / Solutions / exercise01.cpp
blob: 50d2fe02b6194dc57c91ea17a5f20b5d3059f843 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>

using namespace std;

bool isPalindromeArray(int nums[], int len) {
	for (int i = 0; i < len / 2; i++) {
		if (nums[i] != nums[len - 1 - i])
			return false;
	}
	return true;
}

int main() {
	int numbers[5] = { 1, 2, 3, 2, 1 };

	cout << isPalindromeArray(numbers, 5) << endl;
}