Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
150114_ArrayOrdenado
//Title of this code //gcc 4.8.2 #include <stdio.h> short esArrayOrdenado(long d, long a[d]); int main(void) { long v[10] = {5, 4, 5, 2, 1}; if(esArrayOrdenado(10, v)) { printf("SÍ ORDENADO\n\n"); } else { printf("NO ORDENADO\n\n"); } return 0; } short esArrayOrdenado(long d, long a[d]) { long i; for(i = 0 ; i < d - 1 && a[i] <= a[i + 1] ; i++); if(i == d - 1) return 1; for(i = 0 ; i < d - 1 && a[i] >= a[i + 1] ; i++); if(i == d - 1) return 1; return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
My first structure
json formatter
C assignment due sunday
pattern 17
HelloWorld
String copy
simple insertion sort
Spring 2017 Project 2 v.04
BigInteger maxMinSum
kushagra siingh_19BCE0665
Please log in to post a comment.