#include <iostream>
using namespace std;
int main()
{
cout << "main started";
int a = 10, b = 0;
cout << a/b;
cout << "main ending";
}
The above written C++ code is not printing anything on online compiler when run on “OnlineGDB” with C++ 20 vesion.
But the same program when run on g++-14 compiler from homebrew it produces
main started0main ending
I am not getting why?
New contributor
Hardik Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.