How to create an age restricting programme | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to create an age restricting programme

#include <iostream> using namespace std; int main() { int age; cin>>age; int PARENT'S MOBILE NUMBER; if(age>=18) { cout << "Welcome To Cives Joint" <<endl; } if(age<=14) { cin>>PARENT'S MOBILE NUMBER; } else{ cout << "Please EXIT Cives Joint!" <<endl; } return 0; } How can I make the code to work out in such a way that if the age is 14 or less the user is required to input the parent's phone number?

5th Apr 2019, 7:47 AM
Charles Ndiritu
Charles Ndiritu - avatar
3 Answers
5th Apr 2019, 7:58 AM
Arushi Singhania
Arushi Singhania - avatar
+ 5
You can do so but not at SoloLearn. In other editors, you can do so.
5th Apr 2019, 11:38 AM
Arushi Singhania
Arushi Singhania - avatar
0
@Arushi SInghania Can't the programme further provide an input box for the parent's phone number to further act on the phone number?
5th Apr 2019, 8:22 AM
Charles Ndiritu
Charles Ndiritu - avatar