diff --git a/agecontrol.mc b/agecontrol.mc new file mode 100644 index 0000000..fcdc385 --- /dev/null +++ b/agecontrol.mc @@ -0,0 +1,30 @@ +bool ageforalco(int n) +{ + if (n < 21) { + return false; + } + + return true; +} + + + +int main() + { + print("Enter you age: "); + + int age; + age = read_int(); + print_nl(); + + bool result; + result = ageforalco(age); + + if (!result) { + print("You Can Drink!"); + } + else { + print("You Can't drink ):"); + } + print_nl(); + } diff --git a/agecontrol.stdin.txt b/agecontrol.stdin.txt new file mode 100644 index 0000000..410b14d --- /dev/null +++ b/agecontrol.stdin.txt @@ -0,0 +1 @@ +25 \ No newline at end of file diff --git a/agecontrol.stdout.txt b/agecontrol.stdout.txt new file mode 100644 index 0000000..38eb04a --- /dev/null +++ b/agecontrol.stdout.txt @@ -0,0 +1 @@ +You Can Drink! \ No newline at end of file