Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

emonyi / IAX0583

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • IAX0583
  • lab3
  • tbonus.c
Find file
BlameHistoryPermalink
  • emonyi's avatar
    Upload New File · 416f216c
    emonyi committed 6 years ago
    416f216c
tbonus.c 542 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#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;
}