+ 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; }
3 Answers
+ 9
Remove the semicolons after if conditions.
if(a<=11){
//
}
something like this
+ 2
Thanks for the help.