0

Programs on If and If else conditions.... (Please help me here)

1.write a java program (if Statement)that examines 2 integer variables and exchange their values if the first one is greater than the second one? 2.Write a Java program to check whether two integers are equal or not? 3.Write a Java program to check whether a given number is positive or negative? 4.Write a java program to read age of a candidate and determine whether he/she is eligible for casting the vote (Use If -else)? 5.Write a java program to check whether a given number is even or odd?

13th Oct 2021, 4:15 PM
Sboniso
4 Antworten
+ 7
It look like you ask us to do your homework, please take some time to learn yourself, if you dont understand how something work than ask question and give us your code, so we can see where you are wrong and try to help you. Here is start of if-else lection for Java https://www.sololearn.com/learning/1068/2143/4381/1 or if you ask for JavaScript than this: https://www.sololearn.com/learning/1024/1136/1395/1
13th Oct 2021, 4:20 PM
PanicS
PanicS - avatar
+ 3
Also JavaScript and Java are two different language.
13th Oct 2021, 4:27 PM
Nathaniel Temitope Ogunjobi
Nathaniel Temitope Ogunjobi - avatar
+ 2
You can't get answers for your question here. You show your attempt and describe what went wrong, and we will help you. On a side note, you can find all these codes on the internet, so you could just copy paste the codes(but i won't recommend it, do them yourself because the work is given to "you")
13th Oct 2021, 4:43 PM
Rishi
Rishi - avatar