Home
About Us
Privacy Policy
Terms and Conditions
Copyright
Contact Us
Register
Sign In
Search
Questions
RosyX
@RosyX
June 2021
1
38
Report
Write a Java program to display whether the given year is a leap year or not , using a turnery (conditional) operator.
Please give me the Program.
Answers & Comments
GB2010
Hiii....
Programm....
public class Leap year {
public static void main ( string [ ] args ) {
int year = 1900 ;
boolean leap = false ;
if ( year % 4 = = 0 )
{
if ( year % 100 = = 0 )
{
// year is divisible by 400 , hence year ia leap year
if ( year % 400 = = 0 )
leap = true ;
else
leap = false ;
}
else
leap = true ;
}
else
leap = false ;
if ( leap)
system . out .println ( year + " is a leap year " )
else
system.out.println ( year + " is not a leap year " )
}
}
I hope it helps........☺☺☺☺☺☺
1 votes
Thanks 3
GB2010
My programm is absolutely true...
siddhartharao77
Yes..It is absolutely correct Except Small spelling mistakes.
RosyX
thanx i got it
GB2010
mark me as brainlist dear...
GB2010
thanks...
RosyX
welcm
Add an Answer
Please enter comments
Please enter your name.
Please enter the correct email address.
Agree to
terms of service
You must agree before submitting.
Send
More Questions From This User
See All
RosyX
October 2021 | 0 Replies
balance the following chemical equation po4 h2so4 gt h3po4 h2o so2
Answer
RosyX
October 2021 | 0 Replies
balance chemical equation for the following po4 h2so4 h3po4 h2o so4
Answer
RosyX
October 2021 | 0 Replies
hey users what are the consequences of sitting upto late night what are the
Answer
RosyX
September 2021 | 0 Replies
ICSE class 8th question.This chapter ' After Blenheim ', answer the questions gi...
Answer
RosyX
September 2021 | 0 Replies
Please I want only few points for the composition. Please give me a few points t...
Answer
RosyX
September 2021 | 0 Replies
Hey users!My question is :" How to make others feel they are important and not a...
Answer
RosyX
September 2021 | 0 Replies
hey userscan u plz help me a person has irrational negative thoughts she t
Answer
RosyX
September 2021 | 0 Replies
Hey users!" How to remove a person from irrational thinking and negative thought...
Answer
RosyX
September 2021 | 0 Replies
Hey friends!See the sketch drawn.Name the personality and tell me about him.Plz ...
Answer
RosyX
September 2021 | 0 Replies
Can u please answer the 8th & the 9th one.Stepwise please...
Answer
Recommend Questions
normaica19
November 2022 | 0 Replies
pasagot ngayon na ito ipapasa please
faithvalerieturno
November 2022 | 0 Replies
how do early beliefs about constellations effect human culture
Muning1027
November 2022 | 0 Replies
yung tama po pls kailangan ko na bukas na talaga po submit ng modules ko
neshthmd
November 2022 | 0 Replies
is a disease causing organism that lives in humans or other animals and derives ...
gamboelise83
November 2022 | 0 Replies
or directionbf361c2d468f8ffa07252b7f7f4e2a8d 39180
laimarnisle
November 2022 | 0 Replies
What are the possible solution that may help the preservation of our flora and f...
duermejhonber
November 2022 | 0 Replies
why are there differrence between the colling rates of sand and water
namronlamoste24
November 2022 | 0 Replies
supernova elements form...
princeclarkcasipe30
November 2022 | 0 Replies
It is responsible for the extractions og energy from the food we eat...
faderonprincessmae
November 2022 | 0 Replies
please help me if you help me i will follow you
×
Report "Write a Java program to display whether the given year is a leap year or not , u..."
Your name
Email
Reason
-Select Reason-
Pornographic
Defamatory
Illegal/Unlawful
Spam
Other Terms Of Service Violation
File a copyright complaint
Description
Helpful Links
About Us
Privacy Policy
Terms and Conditions
Copyright
Contact Us
Helpful Social
Get monthly updates
Submit
Copyright © 2024 EHUB.TIPS team's - All rights reserved.
Answers & Comments
Programm....
public class Leap year {
public static void main ( string [ ] args ) {
int year = 1900 ;
boolean leap = false ;
if ( year % 4 = = 0 )
{
if ( year % 100 = = 0 )
{
// year is divisible by 400 , hence year ia leap year
if ( year % 400 = = 0 )
leap = true ;
else
leap = false ;
}
else
leap = true ;
}
else
leap = false ;
if ( leap)
system . out .println ( year + " is a leap year " )
else
system.out.println ( year + " is not a leap year " )
}
}
I hope it helps........☺☺☺☺☺☺