Created
March 11, 2017 11:18
-
-
Save adrianulbona/173cfeeceb12e866454f4cb3f468c408 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#define NDEBUG | |
typedef enum { | |
false, true | |
} bool; | |
bool prime(int n) { | |
return false; | |
} | |
int main() { | |
int numbers[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; | |
bool expected[] = {false, true, true, false, true, false, true, false, false}; | |
int n = (int) (sizeof(numbers) / sizeof(int)); | |
for (int i = 0; i < n; i++) { | |
assert(prime(numbers[i]) == expected[i]); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment