From f3fc8ec288c6dbf637b05879f925da1caec8e78a Mon Sep 17 00:00:00 2001 From: mayriann Date: Thu, 19 Jan 2023 10:04:05 -0700 Subject: [PATCH 1/5] Task 2 --- 002.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 002.c diff --git a/002.c b/002.c new file mode 100644 index 0000000..6b227b9 --- /dev/null +++ b/002.c @@ -0,0 +1,35 @@ +#include + +/*A program that asks and reads the score of a user + * If the score is less than 80, display to the user that they are not elgible to be enrolled. + * If the score is greater than or equal 80, they can be enrolled. + */ + +#include + + +int main() +{ + int user; + int score = 80; + + printf("Enter your score: "); + scanf("%c", &score); + + if(user < 80) + { + + printf("Sorry, you are not eligible to be enrolled\n", score); + scanf("%c", &score); + + } + + if(user => 80) + { + printf("Congratulations! You are eligible to be enrolled"); + scanf("%c", &score); + } + + return (0); +} + From 08f7279dc1286ef4fc2b3f99258f3bdb12a9cdbf Mon Sep 17 00:00:00 2001 From: mayriann Date: Thu, 19 Jan 2023 13:09:38 -0700 Subject: [PATCH 2/5] Task 3 --- 003.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 003.c diff --git a/003.c b/003.c new file mode 100644 index 0000000..9f18b72 --- /dev/null +++ b/003.c @@ -0,0 +1,25 @@ +#include + +int main() +{ + int num; + int num1; + + printf ("Enter your number: "); + scanf("%c", &num); + + if (num == num1 == 0) + { + printf ("UserInput is even\n"); + } + + if (num / num1 == 1 ) + { + printf ("UserInput is odd"); + } + + if (num == 0) + { + printf ( "This is Zero"); + } + return (0); From b98cc626595bf4674e49482c8c00469fb11eccef Mon Sep 17 00:00:00 2001 From: mayriann Date: Thu, 19 Jan 2023 13:14:44 -0700 Subject: [PATCH 3/5] Task 3 --- 003.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/003.c b/003.c index 9f18b72..5c73acf 100644 --- a/003.c +++ b/003.c @@ -1,5 +1,12 @@ #include +/* + * A task that displays Odd number,even number and zero + * If the number is even,it displays 'userInput is even' + * If the number is zero,it displays 'This is zero' + * If the number is odd, it displays 'UserInput is odd' + */ + int main() { int num; From 4f78a841c4042e90afac67c300759b767c800d48 Mon Sep 17 00:00:00 2001 From: mayriann Date: Thu, 19 Jan 2023 17:14:18 -0700 Subject: [PATCH 4/5] Task 4 --- 004.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 004.c diff --git a/004.c b/004.c new file mode 100644 index 0000000..06dbfe1 --- /dev/null +++ b/004.c @@ -0,0 +1,26 @@ +#include + + + +/* A program that asks, reads and displays the name, age of a user. + * Name is David + * Age is 65 +*/ + +int main() +{ + int name = David; + int age = 65; + + printf("What is your name: \n"); + scanf("%d", name); + + printf("What is your age: \n"); + scanf("%d", age); + + printf("Your name is %d and you are %d years old"); + + return 0; + +} + From d1471ac3c2766417e9a4328e92d9c8426115e5f6 Mon Sep 17 00:00:00 2001 From: mayriann Date: Thu, 19 Jan 2023 17:36:22 -0700 Subject: [PATCH 5/5] Task 1 --- 001.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 001.c diff --git a/001.c b/001.c new file mode 100644 index 0000000..d86c505 --- /dev/null +++ b/001.c @@ -0,0 +1,20 @@ +#include + +/*A program that prints the alphabet in lowercase, followed by a new line. + * Print all the letters except q and e + * use printf +*/ + +int main () +{ + char apl; + + + for (apl = 'a'; apl <= 'z'; apl != 'e'; apl != 'q'; apl++) + { + printf ("%c", apl); + } + + + return (0); +}