0
9.3kviews
Write a R program to check the leap year or not.
1 Answer
written 2.6 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:-