Odd or Even program in R programming

Editorial Staff - - R Programs


If you want to start learning the R programming or you have a bit knowledge about R programming, then this tutorial will help you to explore more. In this tutorial, we are going to share a Odd or Even program in R programming with an example.

This program will check if the entered number is an Odd number or Even number. First, we divide the input number by 2, if the remainder is 0, then the input number is even number. If the remainder is 1, then the input number is an Odd number.

Try more:

Odd or Even program in R programming with the output

Copy the below code and execute it to see the program output.

Program Output

First try:

Enter a number: 89
89 is Odd Number

Second try:

Enter a number: 42
42 is Even Number


About: Editorial Staff

Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari