diff --git a/TASKS/T3 b/TASKS/T3 new file mode 100755 index 0000000..b86361a Binary files /dev/null and b/TASKS/T3 differ diff --git a/TASKS/T4 b/TASKS/T4 new file mode 100755 index 0000000..4793c69 Binary files /dev/null and b/TASKS/T4 differ diff --git a/TASKS/Task 002.c b/TASKS/Task 002.c index 5cdd390..fee23c9 100644 --- a/TASKS/Task 002.c +++ b/TASKS/Task 002.c @@ -3,4 +3,23 @@ Write 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. -*/ \ No newline at end of file +*/ + +#include + +int main(void) +{ + int score; + + printf("Please enter your score:"); + scanf("%d\n" , &score); + + if (score < 80) + { + printf("you are not eligible to be enrolled\n"); + } + else (score > 80) + { + printf("You can be enrolled\n"); + } +} diff --git a/TASKS/Task 003.c b/TASKS/Task 003.c index 7fca79c..3b456c5 100644 --- a/TASKS/Task 003.c +++ b/TASKS/Task 003.c @@ -6,4 +6,25 @@ If the number is zero, display 'This is zero' NOTE: 'userInput' should be the number entered by the user. -*/ \ No newline at end of file +*/ + +#include +int main(void) +{ + int userInput; + + printf("Please input a number: "); + scanf("%d" , &userInput); + if (userInput % 2 == 0) + { + printf("%d is even\n", userInput); + } + else if (userInput == 0) + { + printf("This is zero\n"); + } + else + { + printf("%d is Odd\n", userInput); + } +} diff --git a/TASKS/Task 004.c b/TASKS/Task 004.c index 17ee38c..f876b15 100644 --- a/TASKS/Task 004.c +++ b/TASKS/Task 004.c @@ -10,5 +10,19 @@ How old are you?: 65 Output: Your name is David and you are 65 years old. +*/ +#include -*/ \ No newline at end of file +int main(void) +{ + char name *[12]; + int age; + + printf("What is your name: "); + scanf("%s", &name); + + printf("How old are you?: "); + scanf("%d", &age); + + printf("Your name is %s and you are %d years old\n", name, age); +} diff --git a/TASKS/Task 006.c b/TASKS/Task 006.c index dc0b9af..a3228cb 100644 --- a/TASKS/Task 006.c +++ b/TASKS/Task 006.c @@ -1,4 +1,21 @@ /* Write a program in C to check a given number is even or odd using the function. -*/ \ No newline at end of file +*/ + +#include + +int main(void) +{ + int num; + + printf("Please enter a number: "); + scanf("%d", &num); + + if (num % 2 == 0) + { + printf("%d is even \n", num); + } + else + printf("%d is odd \n", num); +} diff --git a/TASKS/Task002 b/TASKS/Task002 new file mode 100755 index 0000000..fe29c63 Binary files /dev/null and b/TASKS/Task002 differ diff --git a/TASKS/Task6 b/TASKS/Task6 new file mode 100755 index 0000000..f02d448 Binary files /dev/null and b/TASKS/Task6 differ