Follow along with the video below to see how to install our site as a web app on your home screen.
Note: this_feature_currently_requires_accessing_site_using_safari
#include <stdio.h>
#include <ctype.h>
#define TRUE = 1
#define FALSE = 0
void InputList(int array[50], int &num);
int IsSorted(int array[50], int n);
main()
{
int a[10], num;
InputList(a, num);
IsSorted(a, num);
}
void InputList(int array[50], int &num)
{
int i;
printf("Enter the number of values in the list => ");
scanf("%d", &num);
for(i=0; i < num; ++i)
{
printf("Enter the data item => ");
scanf("%d", &array[i]);
}
}
int IsSorted(int array[], int n)
{
int i;
printf("Items in the original array\n");
for(i = 0; i < n; ++i) {
printf("%4d\n", array[i]);
}
for(i = 0; i < n; ++i) {
for(i = 0; i < n - 1; ++i) {
if (array[i] > array[i + 1]){
printf("Array is not sorted\n");
}
else
{
printf("Array is sorted\n");
}
}
}
return 0;
}