29 lines
777 B
C
29 lines
777 B
C
#include <stdio.h>
|
|
#include "lib/temperature.h"
|
|
#include "lib/array.h"
|
|
#include "lib/base10.h"
|
|
|
|
void swapInt(int *pX, int *pY) {
|
|
int temp = *pX;
|
|
*pX = *pY;
|
|
*pY = temp;
|
|
}
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
int unsortedArray[] = { 1, 5, 2, 1, 4, 8, 3, 2, 6, 7 };
|
|
int sortedArray[] = { 1, 2, 4, 8, 9, 9, 9 };
|
|
|
|
printf("Unsorted Array : ");
|
|
printIntArray(unsortedArray, sizeof(unsortedArray) / sizeof(int));
|
|
printf("Unsorted Array Sorted?: %d\n", checkIntArraySorted(unsortedArray, sizeof(unsortedArray) / sizeof(int)));
|
|
printf("Sorted Array : ");
|
|
printIntArray(sortedArray, sizeof(sortedArray) / sizeof(int));
|
|
printf("Sorted Array Sorted?: %d\n", checkIntArraySorted(sortedArray, sizeof(sortedArray) / sizeof(int)));
|
|
|
|
printf("40C == %dF", (int) celsiusToFarenheit(40.0));
|
|
|
|
}
|