Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions TASKS/Task002.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <stdio.h>

/**
* 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);
}
29 changes: 29 additions & 0 deletions TASKS/Task003.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <stdio.h>

/**
* 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);
}
20 changes: 20 additions & 0 deletions TASKS/Task004.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdio.h>

/**
* 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);
}
23 changes: 23 additions & 0 deletions TASKS/Task006.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <stdio.h>

/**
* 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");
}
}
Binary file added TASKS/a.out
Binary file not shown.
32 changes: 32 additions & 0 deletions TASKS/fruitbaowl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <stdio.h>

/**
* 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);
}
30 changes: 30 additions & 0 deletions TASKS/posicle.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <stdio.h>

/**
* 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);
}