0
How to create this program??
hey guys.. can you help me how to create this program.. "create a program that will ask for the 5 digits and list the odd and even.tnx a lot!..
5 Answers
+ 1
% <-- your answer lies in this.
Make 2 ArrayList. split your 5 digit int into an Array of its own. for loop thru it and for each digit check if it is an even number. if it is add it to your ArrayList of even. else add it to your ArrayList of odd.
if(digit%2==0){
evens.add(digit);
}
else{
odds.add(digit);
}
something like this. try something and if you can't get it, show us the code your working so we have something to go by.
+ 1
sir ..I don't know how to use an array.. I am beginner in java. can u show an a source code? tnx for help.
0
Yup, give me a sec and I will throw something together
0
thank you sir.. I appreciate ur help