0
Anyone knows why it keeps me saying that the code is wrong?
//its c++ #include <iostream> int age; cin >> age; if (age == 16) { cout << "u can drive a motorbike" << endl; } if (age == 18) { cout << "u can drive a car" << endl; }
5 Respostas
+ 5
u need to add main function and std library (using namespace std)
+ 3
Ben Allen (Njinx) ik but in this code is ok to use it
+ 3
using namespace std; is missing firstly and secondly its neccessary to close your code inside
int main ()
{/*your codes here*/}
+ 1
There’s no main function
+ 1
Kawaii While you're correct I wouldn't recommend using namespace std. This can cause conflicts with different libraries. Just prepend std:: to the beginning on each stl function.