+ 3
Age
#include <iostream> using namespace std; int main() { //your code goes here int age; cin >> age; if (age>=16) { cout << "welcome"; } else { cout << "Not allowed"; } }
19 Respuestas
+ 8
Check the spelling of the output. It must be exactly like in the task description
+ 4
Check the task's description for the outputs must be the same as described.
#include <iostream>
using namespace std;
int main() {
//your code goes here
int age;
cin >> age;
if (age>=16&& age <=60)
{
cout << "welcome";
}
else
{
cout << "not allowed";
}
}
+ 4
BlunderKing Please read the thread before you paste your answer here.
+ 3
What are you trying by this code?
when if age >= 16 false then age >= 60 also always false..
+ 2
MMK recheck your reply, it is missing values for the age!
If the task is :
If age >= 16 then output "Welcome" Else print "not allowed" then your code works fine. But just check output statements spelling from the task description. There "Welcome", capital W but you using small w.
"not allowed", all small case but your code has capital N.
If there need to check age <= 60 then add this as nested if condition or by compound condition by using &&. Like :
if ( age >= 16 && age <= 60 )
Hope it clears....
+ 1
If the user enters 63, then 63 is greater or equal 16. The second else if will not be reached.
+ 1
MMK What is the task actually?
Add description here..
+ 1
What is the code supposed to do?
+ 1
greater or equal than what?
+ 1
Lisa thank you so much... It done
I written allways "welcome" but it is "Welcome"
+ 1
Great that you could solve it!
0
How can i solve this
0
#include <iostream>
using namespace std;
int main() {
int age;
cin >> age;
if(age >= 16) {
cout << "welcome";
}
else {
cout << "Not allowed";
}
}
0
Take the client age as a input, then show output "Welcome" if age is greathear or equal to 16. If it’s not show "not allowed".
0
I tried many way but it’s not working, maybe it is bug from sololearn.
0
Client age should be 16 plus, to output "welcome"
0
Ok
0
Thanks all, for your response....