diff --git a/TASKS/Task002.c b/TASKS/Task002.c new file mode 100644 index 0000000..ce8f7c4 --- /dev/null +++ b/TASKS/Task002.c @@ -0,0 +1,23 @@ +#include + +/** + * main - Entry point + * Return: always 0 (success) + */ +int main(void) +{ + int score; + + printf("Please enter your score: "); + scanf("%d", &score); + + if (score < 80) + { + printf("You are not elgible to be enrolled\n"); + } + else if (score >= 80) + { + printf("You are elgible to enroll\n"); + } + return (0); +} diff --git a/TASKS/Task003.c b/TASKS/Task003.c new file mode 100644 index 0000000..b5c9a97 --- /dev/null +++ b/TASKS/Task003.c @@ -0,0 +1,29 @@ +#include + +/** + * main - Entry point + * Return: return 0 sucess + */ + +int main(void) +{ + int num; + + printf("Please input a number: "); + scanf("%i", &num); + + if (num % 2 == 0) + { + printf("User Input is even\n"); + } + else if (num % 2 == 1) + { + printf("User Input is odd\n"); + } + else if (num == 0) + { + printf("This is Zero\n"); + } + + return (0); +} diff --git a/TASKS/Task004.c b/TASKS/Task004.c new file mode 100644 index 0000000..e0397be --- /dev/null +++ b/TASKS/Task004.c @@ -0,0 +1,20 @@ +#include + +/** + * main - entry point + * Return: 0 (sucess) + */ + +int main(void) +{ + char name[20]; + int age; + + printf("What is your name: "); + scanf("%s", name); + printf("How old are you?: "); + scanf("%d", &age); + printf("Your name is %s and your are %d years old.\n", name, age); + + return (0); +} diff --git a/TASKS/Task006.c b/TASKS/Task006.c new file mode 100644 index 0000000..4569ffd --- /dev/null +++ b/TASKS/Task006.c @@ -0,0 +1,23 @@ +#include + +/** + * main - entry point + * Return: 0 (sucess) + */ + +int main(void) +{ + int num; + + printf("Enter a number: "); + scanf("%d", &num); + + if (num % 2 == 0) + { + printf("The number is even\n"); + } + else + { + printf("The number id odd\n"); + } +} diff --git a/TASKS/a.out b/TASKS/a.out new file mode 100755 index 0000000..d312060 Binary files /dev/null and b/TASKS/a.out differ diff --git a/TASKS/fruitbaowl.c b/TASKS/fruitbaowl.c new file mode 100644 index 0000000..7cd99b1 --- /dev/null +++ b/TASKS/fruitbaowl.c @@ -0,0 +1,32 @@ +#include + +/** + * main - entry point + * a program that calcules the amount of pie that can be + * made/baked with an apple fruit + * Return: returns 0 + */ + +int main(void) +{ + int fruit; + int banana; + int apple; + int pie; + + printf("Enter the amount of fruits on the bowl: "); + scanf("%d", &fruit); + + if (fruit >= 6) + { + apple = fruit / 2; + banana = fruit / 2; + pie = apple / 3; + printf("%d\n", pie); + } + else + { + printf("Unknoun amount"); + } + return (0); +} diff --git a/TASKS/posicle.c b/TASKS/posicle.c new file mode 100644 index 0000000..0c2bedc --- /dev/null +++ b/TASKS/posicle.c @@ -0,0 +1,30 @@ +#include + +/** + * main - Entry point + * A program that detrmines whether to give away or keep popsicles + * Return: returns 0 (sucess) + */ + +int main(void) + +{ + int popsicle; + int sibling; + + printf("Enter the amount of popsicles: "); + scanf("%d", &popsicle); + + printf("Enter the number of siblings: "); + scanf("%d", &sibling); + + if (popsicle % 2 == 0 && sibling % 2 == 0) + { + printf("Give away\n"); + } + else + { + printf("Eat them yourself\n"); + } + return (0); +}