I have this code that we can write in two ways
First Way
void func(int val)
{
if(val == 0)
return;
// Do something ...
}
Second Way
void func(int val)
{
if(val != 0)
{
// Do something ...
}
}
The Question:
Is there any reason to use the first way ? Is there any Advantage to use the first way ( in C++ or in C# )