Commit 416f216c by emonyi

Upload New File

parent ee9b1c74
Showing with 40 additions and 0 deletions
#include <stdio.h>
int main () {
int i;
int numberArray[10];
printf("Enter the 10 numbers that need to be checked:\n");
for (i=0; i<10; i++){
scanf("%d", &numberArray[i]);
}
int isasc=1;
for(i=1; i<10; i++){
if(numberArray[i]<numberArray[i-1]){
isasc=0;
}
}
if(isasc==1){
printf("ascending");
return 0;
}
int isdesc=1;
for(i=1; i<10; i++){
if(numberArray[i]>numberArray[i-1]){
isdesc=0;
}
}
if(isdesc==1){
printf("descending");
return 0;
}else printf("neither");
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment