Computer Science, asked by anonymous7763, 7 months ago

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 Arceus02
11

\bf{\underline{\red{Question:-}}}

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).

\rule{400}{4}

\bf{\underline{\red{Programming\:language:-}}}

Turbo C++

\rule{400}{4}

\bf{\underline{\red{Answer:-}}}

#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