{"id":8482,"date":"2023-01-04T23:00:00","date_gmt":"2023-01-04T17:30:00","guid":{"rendered":"https:\/\/www.codingbroz.com\/?p=8482"},"modified":"2023-01-04T18:43:50","modified_gmt":"2023-01-04T13:13:50","slug":"go-program-to-check-whether-a-number-is-even-or-odd","status":"publish","type":"post","link":"https:\/\/www.codingbroz.com\/go-program-to-check-whether-a-number-is-even-or-odd\/","title":{"rendered":"Go Program to Check Whether a Number is Even or Odd"},"content":{"rendered":"\n

In this post, we will learn how to write a program to check whether a number is even or odd using the Go programming language<\/strong>.<\/p>\n\n\n\n

Any number that is completely divisible by 2<\/strong> is called an even number<\/strong>, whereas the number that leaves a remainder when divided by 2<\/strong> is called an odd number<\/strong>.<\/p>\n\n\n\n

The below program asks the user to enter a positive integer, then uses the if… else<\/strong> condition to check whether the entered integer is exactly divisible by 2 or not.<\/p>\n\n\n\n

If the condition is true, then the entered integer is an even number; otherwise, it is an odd number.<\/p>\n\n\n\n

So, without further ado, let\u2019s begin this tutorial.<\/p>\n\n\n\n

\n