# C programming

 Danny AA · December 26, 2014 int arr[10] = { -2, 8, 23, -160, -74, 8, 85, -47, 12, 7 }; PrintMaxPartAscending(arr, 10); that's the array void PrintMaxPartAscending(int arr[], int size) { int i, j = 0, k = 0, counter1 = 0, num = 0, counter2 = 0; printf("The original array is :\n"); for (i = 0; i < size; i++) { printf("%d ", arr); } printf("\n"); for (i = 0; i < size; i++) { if (arr < arr[i+1]) { j = i; counter1++; } } for (i = 0; i < counter1; i++) { printf("%d ", arr); } printf("\n"); } the func need to search the longest ascending numbers and print itin this case it should print (-160, -47,8, 85.)need help pls

## Replies

 Danny AA · December 27, 2014  Thank you Franz Schmidt !!!!!!! Franz Schmidt · December 27, 2014 Ok now I understand http://textuploader.com/6amyHere you are Danny AA · December 27, 2014 but it can be any array not this one specific Danny AA · December 27, 2014 int arr[10] = { -2, 8, 23, -160, -74, 8, 85, -47, 12, 7 };in this arr u need to check the ascending number. -2 is smaller than 8? yescounter++8 is smaller than 23? yescounter++;23 is smaller than -160? nostop and save the numbers you found. now you found the first ascending numbers.now you check-160 is smaller than -47 ? yescounter2++;-74 is smaller than 8 ? yescounter2++;8 is smaller than 85 ? yescounter2++;85 is smaller than -47 ? nostop checking and keep the numbers.now you found the second ascending numbers.and you keep like this until you get to the end of the array.tnx for the help... Franz Schmidt · December 27, 2014 Could you please explain what exactly do you mean with longest ascending numbers??Please give some more examples Danny AA · December 26, 2014 someone can help pls?
• 1

## C

130,030 followers