Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int SIZE, MIDDLE, i, MIN, RESULT;
- printf("Enter array size: ");
- scanf("%d", &SIZE);
- int ARRAY[SIZE];
- for(i = 0; i < SIZE; i++) {
- printf("Element %d: ", i + 1);
- scanf("%d", &ARRAY[i]);
- }
- MIDDLE = ARRAY[SIZE / 2];
- for(i = 0, MIN = ARRAY[0]; i < SIZE; i++) {
- if (ARRAY[i] < MIN) {
- MIN = ARRAY[i];
- }
- }
- if (MIN == MIDDLE) {
- RESULT = 1;
- } else {
- RESULT = 0;
- }
- printf("%d\n", RESULT);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment