0
16kviews
Write a R program to check the leap year or not.
1 Answer
0
1.1kviews

Explanation:-

  • Take year as a input from the user and store it in a variable y.
  • Check if divisible by 4 but not 100, DISPLAY "leap year"
  • Check if the year is divisible by 400, DISPLAY "leap year"
  • Otherwise, DISPLAY "not leap year"

Code:-

y = as.numeric(readline(prompt = 'year'))
if …

Create a free account to keep reading this post.

and 2 others joined a min ago.

Please log in to add an answer.