I'm typing everything right, no errors, it even said success when i compiled it but when i run it it closes. HELP PLEASEEEE?!
read the reference
Try putting this at the end or your int main:
Nope, execute console programs from the console.
Your IDE should provide a wrapper for the execution, so it will survive to your program (you'll get the output in case of exceptions, fatal errors, calls to exit(), etc)