Javatpoint Logo
Javatpoint Logo

Even Odd Program

Even numbers are those which are divisible by 2. Numbers like 2,4,6,8,10, etc are even.

Odd numbers are those which are not divisible by 2. Numbers Like 1, 3, 5, 7, 9, 11, etc are odd.

Logic:

  • Take a number.
  • Divide it by 2.
  • If the remainder is 0, print number is even.

Even Odd Program in PHP

A program to check 1233456 is odd or even is shown.

Example:

Output:

PHP Even odd program 1

Even Odd Program using Form in PHP

By inserting value in a form we can check that inserted value is even or odd.

Example:

Output:

On entering the number 23456, following output appears.

PHP Even odd program 2

On entering the number 285965, following output appears.

PHP Even odd program 3
Next TopicPrime Number





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA