is it a compiler issue? I compile and run the code using:
1 2
g++ code.cpp
./a.out
and the output is:
1 2
Enter two numbers
Your numbers are: 0 0
Edit: I figured the issue, it has nothing to do with c++ but with the noevim editor, I compile and run the code from within neovim and it doesn't accept user input. Running a.out from the terminal solves the issue.
Thank you for your help, I figured the issue, it has nothing to do with c++ but with the noevim editor, I compile and run the code from within neovim and it doesn't accept user input. Running a.out from the terminal solved the issue.
What found is that following #include <iostream> there are unnecessary spaces in the file. Not that this will cause any problems.
I am not familiar with "noevim", but as I understand "g++" the compiler generates ".a" files that are then linked with any other needed files to form the ".exe" program. At least that is my understanding.