Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- bool positivo(int array[], int length) {
- for (int i = 0; i < length; ++i) {
- if (array[i] < 0)
- return false;
- }
- return true;
- }
- int main() {
- int test[] = {1, 2, 3, -8, 5};
- printf("%d\n", positivo(test, 5));
- }
Advertisement
Add Comment
Please, Sign In to add comment