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
Binary file added TASKS/T3
Binary file not shown.
Binary file added TASKS/T4
Binary file not shown.
21 changes: 20 additions & 1 deletion TASKS/Task 002.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
*/

#include <stdio.h>

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");
}
}
23 changes: 22 additions & 1 deletion TASKS/Task 003.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,25 @@ If the number is zero, display 'This is zero'

NOTE: 'userInput' should be the number entered by the user.

*/
*/

#include <stdio.h>
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);
}
}
16 changes: 15 additions & 1 deletion TASKS/Task 004.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,19 @@ How old are you?: 65

Output:
Your name is David and you are 65 years old.
*/
#include <stdio.h>

*/
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);
}
19 changes: 18 additions & 1 deletion TASKS/Task 006.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
/*
Write a program in C to check a given number is even
or odd using the function.
*/
*/

#include <stdio.h>

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);
}
Binary file added TASKS/Task002
Binary file not shown.
Binary file added TASKS/Task6
Binary file not shown.