From 78a63334165f272963a34cb867227a7b23029190 Mon Sep 17 00:00:00 2001 From: Billyice777 Date: Wed, 18 Jan 2023 20:33:19 +0100 Subject: [PATCH] source code for tutorial class task --- TASKS/Task 002.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/TASKS/Task 002.c b/TASKS/Task 002.c index 5cdd390..c897301 100644 --- a/TASKS/Task 002.c +++ b/TASKS/Task 002.c @@ -3,4 +3,32 @@ 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 + +/** + * main - A program to reads user scores + * + * Return: 0 (success) + */ +int main(void) +{ + int myScore; + + /*Ask the student to input score*/ + printf("Type in your score please: \n"); + /*Get and save the number the student types*/ + scanf("%d", &myScore); + /*Output the number the user typed*/ + printf("Your score is : %d\n", myScore); + + if (myScore >= 80) + { + printf("Congratulations you have met the cut off\n"); + } + else if (myScore < 80) + { + printf("You are not eligible to continue with the program\n"); + } + return (0); +}