Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <limits.h>
- #include <stdlib.h>
- int main()
- {
- int input;
- int isInt;
- int endResult = NULL;
- int lastResult = INT_MIN;
- printf("Enter the elements of the array. After each element press ENTER key\n");
- while (endResult == NULL) {
- scanf("%d", &input);
- if (lastResult > input) {
- endResult = input;
- }
- else {
- lastResult = input;
- }
- }
- printf("Result: %d\n", endResult);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement