6th Aug 2018, 3:29 PM
Will
Will - avatar
8 Respuestas
+ 2
Will there are so many errors.. I have commented what changes I have done into below code : #include <iostream> using namespace std; // Age Evaluater int main() { int age; cin >> age; // it should not be << operator with cin //return 0; //if return is there, next code doesnot get executed if (age <= 17)// braket for condition { printf("Sorry, you need to be 18 years or older");//1.semicolon for statement end 2. its string not character...so, ' ' is replaced with "" 3. print is not there..printf is used } else if (age >= 18) //bracket and elif should be else if { printf("Welcome! Sign up or log in here: ");// semicolon and "" instead of '' Nd printf } return 0;//added here }// added here Feel free to ask if you have any questions in updated code
6th Aug 2018, 3:45 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 2
Will ..np... different languages have different syntax..u will be familiar to it soon... happy learning..
6th Aug 2018, 3:49 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 2
Will refer below changes to be done: 1. entry point is int main()...so, it must have it... post int Main () , your entire code should be enclosed within {}... so, add these two it... 2. cout << endl should be there... so, instead of +endl, do it like << endl in both if and else.. feel free to ask for any clarification
6th Aug 2018, 4:10 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 2
perfect now Will ...it works fine... just do mention return 0 ; as second last line just before }.. return 0 indicate that your entire code worked fine and there is no error fro m code execution.people returns negative values to indicate some failure of code like file access etc
6th Aug 2018, 4:23 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
Ketan Lalcheta Thanks again! It seems to be working now. Would you mind just checking it one last time just in case? Thanks.
6th Aug 2018, 4:17 PM
Will
Will - avatar
+ 1
you only have to add return 0 ... everything is fine https://code.sololearn.com/c6B2q3tJ31Xj/?ref=app
6th Aug 2018, 4:24 PM
Rishabh
Rishabh - avatar
0
Ketan Lalcheta Thanks so much, I am thinking in Python and JavaScript!
6th Aug 2018, 3:47 PM
Will
Will - avatar
0
Ketan Lalcheta I fixed it up a little but it is still not working. Can you show me my errors please?
6th Aug 2018, 4:06 PM
Will
Will - avatar