Skip to main content
added 180 characters in body
Source Link
syb0rg
  • 21.9k
  • 10
  • 113
  • 192

@Filipe hit the main point I wanted to cover. But there are some minor improvements that can be made.


Remove the != 0 for maximum C-ness.

if (value % 2)

If you are not taking any parameters into main(), you should declare them void.

int main(void)

You don't have any return statement, yet you declare that you are returning an int. Let's return 0 at the end of our program to indicate success.

return 0;

@Filipe hit the main point I wanted to cover. But there are some minor improvements that can be made.


Remove the != 0 for maximum C-ness.

if (value % 2)

If you are not taking any parameters into main(), you should declare them void.

int main(void)

@Filipe hit the main point I wanted to cover. But there are some minor improvements that can be made.


Remove the != 0 for maximum C-ness.

if (value % 2)

If you are not taking any parameters into main(), you should declare them void.

int main(void)

You don't have any return statement, yet you declare that you are returning an int. Let's return 0 at the end of our program to indicate success.

return 0;
Source Link
syb0rg
  • 21.9k
  • 10
  • 113
  • 192

@Filipe hit the main point I wanted to cover. But there are some minor improvements that can be made.


Remove the != 0 for maximum C-ness.

if (value % 2)

If you are not taking any parameters into main(), you should declare them void.

int main(void)