fork download
  1. #include <stdio.h>
  2. int main() {
  3. int arr[10];
  4. int isIncreasing = 1; // Flag to check if the array is in increasing order
  5.  
  6. printf("Enter 10 integers:\n");
  7. for (int i = 0; i < 10; i++) {
  8. printf("Value %d: ", i + 1);
  9. scanf("%d", &arr[i]);
  10. }
  11.  
  12. for (int i = 0; i <9 ; i++) {
  13. if (arr[i] >= arr[i + 1]) {
  14. isIncreasing = 0; // Not in increasing order
  15. break;
  16. }
  17. }
  18.  
  19. if (isIncreasing) {
  20. printf("The array is in increasing order.\n");
  21. } else {
  22. printf("The array is not in increasing order.\n");
  23. }
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 5296KB
stdin
Standard input is empty
stdout
Enter 10 integers:
Value 1: Value 2: Value 3: Value 4: Value 5: Value 6: Value 7: Value 8: Value 9: Value 10: The array is not in increasing order.