--- /dev/null
+/* Desc: Enumeration teste
+ * Usage: ./test
+ * Ref/Attrib: [5] https://www.geeksforgeeks.org/enumeration-enum-c/
+ */
+
+#include <stdio.h>
+//#include <stdlib.h>
+
+enum year{Jan, Feb, Mar, Apr, May, Jun, Jul,
+ Aug, Sep, Oct, Nov, Dec};
+
+int main(){
+ int i;
+ for (i=Jan; i<=Dec; i++)
+ printf("%d ", i);
+
+ printf("\n\nDone\n\n");
+ return 0;
+};
+
+
+
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc: simple temperature converter
+ * Usage: ./test
+ * Ref/Attrib: The C Programming Language, 2nd Edition, Section 1.2
+ */
+
+#include <stdio.h>
+//#include <stdlib.h>
+
+/* print Fahrenheit-Celsius table for fahr = 0, 20, ..., 300 */
+
+int main(){
+ int fahr, celsius;
+ int lower, upper, step;
+
+ lower = 0; /* lower limit of temperature table */
+ upper = 300; /* upper limit */
+ step = 20; /* step size */
+
+ fahr = lower;
+ while (fahr <= upper){
+ celsius = 5 * (fahr-32) / 9;
+ printf("%3d %6d\n", fahr, celsius);
+ fahr = fahr + step;
+ };
+
+
+ printf("\n\nDone\n\n");
+ return 0;
+};
+
+
+
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc: simple temperature converter
+ * Usage: ./s1..c_to_f_float.c
+ * Ref/Attrib: The C Programming Language, 2nd Edition, Section 1.2
+ */
+
+#include <stdio.h>
+//#include <stdlib.h>
+
+/* print Celsius-Fahrenheit table for celsius = -50, -40, ..., 100 */
+
+int main(){
+ float fahr, celsius;
+ int lower, upper, step;
+
+ lower = -50; /* lower limit of temperature table */
+ upper = 100; /* upper limit */
+ step = 5; /* step size */
+
+ celsius = lower;
+ printf(" °C, °F\n");
+ while (celsius <= upper){
+ fahr = (celsius * (9.0 / 5.0)) + 32.0;
+ printf("%3.0f,%7.2f\n", celsius, fahr);
+ celsius = celsius + step;
+ };
+
+
+ printf("\n\nDone\n\n");
+ return 0;
+};
+
+
+
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+#!/usr/bin/env bash
+# Desc: Compiles all `.c` files in specified directory
+# Usage: compile.sh [DIR]
+
+# Check args
+if [[ ! -d $1 ]]; then echo "FATAL:Not a dir:$1" 1>&2; exit 1; fi;
+
+for file in ./*.c; do
+ if [[ ! -f $file ]]; then echo "FATAL:Not a file:$file" 1>&2; exit 1; fi;
+ echo "STATUS: file:$file" 1>&2;
+ file_out="${file%.c}";
+ echo "STATUS:file_out:$file_out" 1>&2;
+ gcc -o "$file_out" "$file" || echo "ERROR:Compile failed." 1>&2;
+ echo "" 1>&2;
+done;
--- /dev/null
+#!/usr/bin/env bash
+# Desc: Compiles all `.c` files in specified directory
+# Usage: compile.sh [DIR]
+
+# Check args
+if [[ ! -d $1 ]]; then echo "FATAL:Not a dir:$1" 1>&2; exit 1; fi;
+
+for file in ./*.c; do
+ if [[ ! -f $file ]]; then echo "FATAL:Not a file:$file" 1>&2; exit 1; fi;
+ echo "STATUS: file:$file" 1>&2;
+ file_out="${file%.c}";
+ echo "STATUS:file_out:$file_out" 1>&2;
+ gcc -o "$file_out" "$file"; # compile
+done;
--- /dev/null
+/* Desc: simple temperature converter
+ * Usage: ./s1..f_to_c_float.c
+ * Ref/Attrib: The C Programming Language, 2nd Edition, Section 1.2
+ */
+
+#include <stdio.h>
+//#include <stdlib.h>
+
+/* print Fahrenheit-Celsius table for fahr = 0, 20, ..., 300 */
+
+int main(){
+ float fahr, celsius;
+ int lower, upper, step;
+
+ lower = 0; /* lower limit of temperature table */
+ upper = 300; /* upper limit */
+ step = 20; /* step size */
+
+ fahr = lower;
+ printf(" °F, °C\n");
+ while (fahr <= upper){
+ celsius = (5.0/9.0) * (fahr-32.0);
+ printf("%3.0f,%6.1f\n", fahr, celsius);
+ fahr = fahr + step;
+ };
+
+
+ printf("\n\nDone\n\n");
+ return 0;
+};
+
+
+
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */