Nivå 3.4 oppgavesamling C++

Задание 1

Gitt en array med tall

cppint arr[] = {1, -2, -3, 4, -5, 6};

Tell antall negative tall i denne arrayen.

Задание 2

Gitt et heltall:

cppint num = 1357;

Sjekk om alle sifrene i dette tallet er oddetall.

Задание 3

Gitt et tall:

cppint num = 12345;

Få en array med sifrene i dette tallet:

cppint arr[] = {1, 2, 3, 4, 5};
Задание 4

Gitt to arrays:

cppint arr1[] = {1, 2, 3};
int arr2[] = {4, 5, 6};

Slå sammen disse arrayene til én:

cppint arr[] = {1, 2, 3, 4, 5, 6};