0
9.2kviews
Write a R program to check the leap year or not.
1 Answer
written 2.5 years ago by |
Explanation:-
Code:-
y = as.numeric(readline(prompt = 'year'))
if ((y %% 4) == 0){
if ((y %% 100) == 0){
if ((y%% 400) ==0){
print(paste(y,'is a leap year'))
}
else {
print(paste(y,"is not a leap year"))
}
}
else{
print(paste(y,"is a leap year"))
}
}else{
print(paste(y,"is not a leap year"))
}
Output:-