--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ int age = 40;
+ double gpa = 3.6;
+ char grade = 'A'; // must use single-quotes
+ char phrase[100] = "baltakatei";
+
+ printf("\n");
+ printf("age:%i\n", age);
+ printf("gpa:%f\n", gpa); // %f indicates float or double?
+ printf("phrase:%s\n", phrase);
+ printf("\n");
+
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ int favNum = 90;
+ char myChar = 'i';
+ printf("\n");
+ printf("Hello \"World\".\n");
+ printf("%d\n", 500); // 'd' for digit?
+ printf("My favorite number is %d\n", 500);
+ printf("My favorite %s is %d\n", "number", 500);
+ printf("My favorite %s is %f\n", "number", 500.98764); // 'f' for float?
+ printf("My favorite %s is %d\n", "number", favNum);
+ printf("My favorite character is %c\n", myChar);
+
+ printf("\n");
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+int main()
+{
+
+ int num = 6;
+ printf("%f\n", 3.141592); // 'f' for floating-point number
+ printf("%f\n", 5.0 * 9.5); // 'f' for floating-point number
+ printf("%f\n", 5 * 9.5); // int + float results in float
+ printf("%d\n", 5 / 4); // doesn't show decimals
+ printf("%f\n", 5 / 4.0);
+ printf("%d\n", num); // print an int variable
+ printf("%f\n", pow(4, 3)); // exponentiation; requires <math.h> to be included
+ printf("%f\n", sqrt(36)); // square root
+ printf("%f\n", ceil(36.356)); // ceiilng; rounds up
+ printf("%f\n", floor(36.356)); // ceiilng; rounds down
+
+ printf("\n");
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main()
+{
+ /* asdf
+ * My Program
+ */
+
+
+ /*
+ //This prints out text.
+ printf("Comments are fun.");
+ */
+
+ printf("\n");
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main()
+{
+ const int FAV_NUM = 5;
+ printf("%d\n", FAV_NUM);
+ // num = 8;
+ printf("%d\n", FAV_NUM);
+
+ printf("%d", 90);
+
+
+ /*
+ //This prints out text.
+ printf("Comments are fun.");
+ */
+
+ printf("\n");
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ * [2] C: Multiple scanf's, when I enter in a value for one scanf it skips the second scanf https://stackoverflow.com/a/9562355
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main()
+{
+ int age;
+ printf("Enter your age: ");
+ scanf("%d", &age); // scanf is like opposite of printf
+ getchar(); // Need to run getchar() after each scanf() in order to clear
+ // scanf() input buffer for next scanf() command.
+ printf("You are %d years old\n", age);
+
+ double gpa;
+ printf("Enter your gpa: ");
+ scanf("%lf", &gpa); // lf tells scanf you are looking for adouble
+ getchar();
+ printf("Your GPA is %f\n", gpa);
+
+ char grade;
+ printf("Enter your grade: ");
+ scanf("%c", &grade); // lf tells scanf you are looking for adouble
+ getchar();
+ printf("Your grade is %c\n", grade);
+
+ printf("\n");
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ * [2] C: Multiple scanf's, when I enter in a value for one scanf it skips the second scanf https://stackoverflow.com/a/9562355
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main()
+{
+ char name[20]; // storing string as an array of chars
+ printf("Enter your name: ");
+ scanf("%s", name); // lf tells scanf you are looking for adouble. drops chars after space.
+ //getchar();
+ printf("Your name is %s\n", name);
+
+ printf("\n");
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ * [2] C: Multiple scanf's, when I enter in a value for one scanf it skips the second scanf https://stackoverflow.com/a/9562355
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main()
+{
+ char name[256]; // storing string as an array of chars
+ printf("Enter your name: ");
+ fgets(name, 256, stdin); // fgets grabs whole line of text. exits when newline entered by user. includes newline in stored string.
+ //getchar();
+ printf("Your name is %s\n", name);
+
+ printf("\n");
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc: calculator to add two integers
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ * [2] C: Multiple scanf's, when I enter in a value for one scanf it skips the second scanf https://stackoverflow.com/a/9562355
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main()
+{
+ int num1;
+ int num2;
+ printf("Enter first number: ");
+ scanf("%d", &num1);
+ getchar();
+ printf("Enter second number: ");
+ scanf("%d", &num2);
+
+ printf("Answer: %d", num1 + num2);
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ * [2] C: Multiple scanf's, when I enter in a value for one scanf it skips the second scanf https://stackoverflow.com/a/9562355
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main()
+{
+ char color[20];
+ char pluralNoun[20];
+ char celebrityF[20];
+ char celebrityL[20];
+
+ printf("Enter a color: ");
+ scanf("%s", color);
+ printf("Enter a plural noun: ");
+ scanf("%s", pluralNoun);
+ printf("Enter a celebrity: ");
+ scanf("%s%s", celebrityF, celebrityL);
+
+ printf("Roses are %s\n", color);
+ printf("%s are blue\n", pluralNoun);
+ printf("I love %s %s\n", celebrityF, celebrityL);
+
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc:
+ * Usage: ./test
+ * Ref/Attrib: [0] C programming tutorial for beginners https://youtu.be/KJgsSFOSQv0?t=5512
+ * [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ * [2] C: Multiple scanf's, when I enter in a value for one scanf it skips the second scanf https://stackoverflow.com/a/9562355
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main()
+{
+ int luckyNumbers[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
+ luckyNumbers[3] = 200;
+ printf("%d", luckyNumbers[3]);
+
+ return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+/* Desc: Function example
+ * Usage: ./test
+ * Ref/Attrib: [0] C programming tutorial for beginners https://youtu.be/KJgsSFOSQv0?t=5814
+ * [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ * [2] C: Multiple scanf's, when I enter in a value for one scanf it skips the second scanf https://stackoverflow.com/a/9562355
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void sayHi(char name[], int age){
+ printf("Hello %s, you are %d.\n", name, age);
+};
+
+int main()
+{
+ printf("Top\n");
+ sayHi("Balta Katei", 671);
+ sayHi("Kodaw Kuori", 350);
+ sayHi("Samki Licui", 21);
+ printf("bottom\n");
+ return 0;
+};
+
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
--- /dev/null
+#!/bin/bash
+date --iso-8601=ns;
+TIMEFORMAT='real: %3R user: %3U sys: %3S cpu: %P'; time gcc -o test test.c;
+TIMEFORMAT='real: %3R user: %3U sys: %3S cpu: %P'; time ./test;
+ls -al test.c
+ls -al test
-/*
- * Author: Steven Baltakatei Sandoval
- * Purpose: Test my Emacs C setup
- * Copyright 2022
+/* Desc: Return example
+ * Usage: ./test
+ * Ref/Attrib: [0] C programming tutorial for beginners https://youtu.be/KJgsSFOSQv0?t=6338
+ * [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ * [2] C: Multiple scanf's, when I enter in a value for one scanf it skips the second scanf https://stackoverflow.com/a/9562355
*/
+
#include <stdio.h>
+#include <stdlib.h>
+
int main()
{
- puts("Hi, my name is 'Baltakatei'.");
+
return 0;
-}
+};
+
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */