diff --git a/Age.c b/Age.c new file mode 100644 index 0000000..ff3e51a --- /dev/null +++ b/Age.c @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + printf("I am %d years old\n", 21); + return 0; +} diff --git a/Age2.c b/Age2.c new file mode 100644 index 0000000..0669211 --- /dev/null +++ b/Age2.c @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + printf("I am %d years old \nHe is %d years old\n", 21, 22); + return 0; +} diff --git a/Age3.c b/Age3.c new file mode 100644 index 0000000..3a0c612 --- /dev/null +++ b/Age3.c @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + printf("I am %d years old \nHe is %d years old\n", 21); + return 0; +} diff --git a/Average Grade.c b/Average Grade.c new file mode 100644 index 0000000..503acc4 --- /dev/null +++ b/Average Grade.c @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + printf("Average grade: %1f\n", 93.7); + return 0; +} diff --git a/Binaries/Age b/Binaries/Age new file mode 100755 index 0000000..7fc1355 Binary files /dev/null and b/Binaries/Age differ diff --git a/Binaries/Age2 b/Binaries/Age2 new file mode 100755 index 0000000..b6ed3e0 Binary files /dev/null and b/Binaries/Age2 differ diff --git a/Binaries/Age3 b/Binaries/Age3 new file mode 100755 index 0000000..d1fe1a2 Binary files /dev/null and b/Binaries/Age3 differ diff --git a/Binaries/Average Grade b/Binaries/Average Grade new file mode 100755 index 0000000..92508ce Binary files /dev/null and b/Binaries/Average Grade differ diff --git a/Binaries/Caulculator b/Binaries/Caulculator new file mode 100755 index 0000000..27f8883 Binary files /dev/null and b/Binaries/Caulculator differ diff --git a/Binaries/Full Name, Age, and Gender b/Binaries/Full Name, Age, and Gender new file mode 100755 index 0000000..c31bad6 Binary files /dev/null and b/Binaries/Full Name, Age, and Gender differ diff --git a/Binaries/Rectangle b/Binaries/Rectangle new file mode 100755 index 0000000..f54e05e Binary files /dev/null and b/Binaries/Rectangle differ diff --git a/Binaries/Triangle b/Binaries/Triangle new file mode 100755 index 0000000..48f6c5d Binary files /dev/null and b/Binaries/Triangle differ diff --git a/Binaries/Triangle2 b/Binaries/Triangle2 new file mode 100755 index 0000000..9ad030c Binary files /dev/null and b/Binaries/Triangle2 differ diff --git a/Binaries/User Input b/Binaries/User Input new file mode 100755 index 0000000..a71bb9e Binary files /dev/null and b/Binaries/User Input differ diff --git a/Binaries/User Input2 b/Binaries/User Input2 new file mode 100755 index 0000000..93014de Binary files /dev/null and b/Binaries/User Input2 differ diff --git a/Binaries/Variables b/Binaries/Variables new file mode 100755 index 0000000..21d6cc0 Binary files /dev/null and b/Binaries/Variables differ diff --git a/Binaries/Year b/Binaries/Year new file mode 100755 index 0000000..d75d80b Binary files /dev/null and b/Binaries/Year differ diff --git a/Binaries/first-and-last-name b/Binaries/first-and-last-name new file mode 100755 index 0000000..8875d39 Binary files /dev/null and b/Binaries/first-and-last-name differ diff --git a/Binaries/first-program b/Binaries/first-program new file mode 100755 index 0000000..fec8f61 Binary files /dev/null and b/Binaries/first-program differ diff --git a/Caulculator.c b/Caulculator.c new file mode 100644 index 0000000..dec6dfc --- /dev/null +++ b/Caulculator.c @@ -0,0 +1,11 @@ +#include +#include + +int main() +{ + printf("%d + %d = %d\n", 5, 2, 5+2); + printf("%d - %d = %d\n", 5, 2, 5-2); + printf("%d * %d = %d\n", 5, 2, 5*2); + printf("%d / %d = %d + %d / 2 \n", 5, 2, 5/2, 5 % 2); + return 0; +} diff --git a/Full Name, Age, and Gender.c b/Full Name, Age, and Gender.c new file mode 100644 index 0000000..c37c13b --- /dev/null +++ b/Full Name, Age, and Gender.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + printf("Full name: Henry Olson \nAge: 15 \nGender: Male\n"); + return 0; +} diff --git a/Rectangle.c b/Rectangle.c new file mode 100644 index 0000000..6e4bce9 --- /dev/null +++ b/Rectangle.c @@ -0,0 +1,20 @@ +#include +#include + +int main() { + float l, w; /* Length and Width */ + + printf("Rectangle Area\n"); + + printf("Length: "); + scanf("%f", &l); + + printf("width: "); + scanf("%f", &w); + + printf("Area: %f\n", l*w); /* Area = length x width */ + + return 0; +} + + diff --git a/Triangle.c b/Triangle.c new file mode 100644 index 0000000..6e0c5c8 --- /dev/null +++ b/Triangle.c @@ -0,0 +1,20 @@ +#include + +int main() +{ + printf(" /\\\n"); + printf(" / \\\n"); + printf(" / \\\n"); + printf(" / \\\n"); + printf(" / \\\n"); + printf("/__________\\\n"); + return 0; +} + + +/* /\ + / \ + / \ + / \ + / \ + /__________\ */ diff --git a/Triangle2.c b/Triangle2.c new file mode 100644 index 0000000..bad603a --- /dev/null +++ b/Triangle2.c @@ -0,0 +1,14 @@ +#include + +int main() +{ + printf(" /\\\n / \\\n / \\\n / \\\n / \\\n/__________\\\n"); + return 0; +} + +/* /\ + / \ + / \ + / \ + / \ + /__________\ */ diff --git a/User Input.c b/User Input.c new file mode 100644 index 0000000..98b4311 --- /dev/null +++ b/User Input.c @@ -0,0 +1,9 @@ +#include + +int main() +{ + char myString[100]; + scanf("%s", &myString); + printf("%s\n", &myString); + return 0; +} diff --git a/User Input2.c b/User Input2.c new file mode 100644 index 0000000..6655aac --- /dev/null +++ b/User Input2.c @@ -0,0 +1,10 @@ +#include + +int main() +{ + char myString[100]; + printf("Message: "); + fgets(myString, sizeof(myString), stdin); + printf("%s\n", myString); + return 0; +} diff --git a/Variables.c b/Variables.c new file mode 100644 index 0000000..99e14a9 --- /dev/null +++ b/Variables.c @@ -0,0 +1,12 @@ +#include +#include + +int main() { + int num; + printf("What is num: "); + scanf("%d", &num); + printf("num is %d\n", num); + return 0; +} + + diff --git a/Year.c b/Year.c new file mode 100644 index 0000000..1bc75e8 --- /dev/null +++ b/Year.c @@ -0,0 +1,20 @@ +#include +#include + +int main() { + int yr; /* Year */ + int byr; /* Birth Year */ + + printf("What is the current year: "); + scanf("%d", &yr); + + printf("What is your year of birth: "); + scanf("%d", &byr); + + printf("Current year: %d\n", yr); + printf("Your year of birth %d\n", byr); + + return 0; +} + + diff --git a/first-program.c b/first-program.c new file mode 100644 index 0000000..10c4e01 --- /dev/null +++ b/first-program.c @@ -0,0 +1,10 @@ +#include +#include + +int main() +{ + printf("Henry Olson\n"); + return 0; +} + +