Write a program that takes the name and age of the user as input and displays a message whether the
user is eligible to apply for a driving license or not. (the eligible age is 18 years).
Answers
Answered by
11
Write a program that takes the name and age of the user as input and displays a message whether the user is eligible to apply for a driving license or not. (the eligible age is 18 years).
Turbo C++
#include<iostream.h>
#include<conio.h>
void main()
{
ㅤㅤㅤㅤchar name[50];
ㅤㅤㅤㅤint age;
ㅤㅤㅤㅤcout<<"Enter your name"<<endl;
ㅤㅤㅤㅤcin>>name;
ㅤㅤㅤcout<<"Enter your age"<<endl;
ㅤㅤㅤㅤcin>>age;
ㅤㅤㅤㅤif (age<18)
ㅤㅤㅤㅤ{
ㅤㅤㅤㅤㅤㅤcout<<name<<"you are not ㅤㅤㅤㅤㅤㅤeligible to apply for a driving ㅤㅤㅤㅤㅤㅤlicense"<<endl;
ㅤㅤㅤㅤ}
ㅤㅤㅤㅤelse
ㅤㅤ ㅤㅤ{
ㅤㅤㅤㅤㅤㅤ cout<<name<<"you are ㅤㅤㅤㅤㅤㅤㅤㅤㅤeligible to apply for a ㅤㅤㅤㅤㅤㅤㅤㅤdriving license"<<endl;
ㅤㅤㅤㅤ}
getch();
}
Similar questions
Science,
5 months ago
Computer Science,
5 months ago
Biology,
5 months ago
English,
10 months ago
Physics,
1 year ago