+ 1

why is this code not working

It is supossed to say what you are. For example if you are under 11 then it is supossed to say you are not a teenager.Insted it prints out all the strings toghther. #include <iostream> using namespace std; int main() { int a=34; cin>>a; if (a<=11);{ cout<<"you are not a teenager "; } if (a<=18);{ cout<<"you are a minor "; } if (a<=75);{ cout<<"you do not quilify for the elder special discount "; } if (a>=75){ cout<<"you do quilify for the elder special discount"; } return 0; }

29th Oct 2017, 7:57 PM
Nate Bowles
3 Answers
+ 9
Remove the semicolons after if conditions. if(a<=11){ // } something like this
29th Oct 2017, 8:00 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 2
Thanks for the help.
2nd Nov 2017, 12:18 AM
Nate Bowles