diff --git a/include/task1.h b/include/task1.h new file mode 100644 index 0000000..3488fad --- /dev/null +++ b/include/task1.h @@ -0,0 +1 @@ +int ageCheck (int age); diff --git a/src/main1.cpp b/src/main1.cpp new file mode 100644 index 0000000..95314da --- /dev/null +++ b/src/main1.cpp @@ -0,0 +1,17 @@ +#include "task1.h" +#include + +int main() + +{ + int age=0; + printf("how old are you? "); + scanf("%d,&age"); + int result=ageCheck(age); + if(result==0) + printf("access granted!\n"); + else + printf("access denied!\n"); + return 0; + +} \ No newline at end of file diff --git a/src/task1.cpp b/src/task1.cpp new file mode 100644 index 0000000..38391d8 --- /dev/null +++ b/src/task1.cpp @@ -0,0 +1,8 @@ +#include "task1.h" +int ageCheck(int age) +{ if(age>=18) + return 1; + else + return 0; + +} \ No newline at end of file