Why we need return statement

Sir in int main() we write return 0;
why is it necessary??? even if we dont write return 0 still programm works hen why we need return statement???

@tejasddongare yes its optional. actually you see when you make int functions( if studied functions) you have to return something so return 0 in int main means terminating the program there .
like example if(n%2==0) cout<<even; now you can write return 0 just after cout and program will end otherwise it will end unless main function is closed.
so conclusion its your wish whether write it or not
dont forget to hit like and mark resolved if cleared :smiley: