create an array of 10 integers and create another array from the 1st array containing all even numbers followed by all odd numbers
sample input-7,8,6,1,4,3,5,11,16,17
sample output-8,6,4,167,1,3,5,11,17
(correct answer with the full program in java)
Answers
Answered by
3
Answer:
Use the round(), floor() and ceil() static methods in the Math class. round() will round to the nearest integer, whilst floor() will round down and ceil() will round up.
float f = 9.3f;
Math.round(f); //Output is 9
Math.ceil(f); //Output is 10
Math.floor(f); //Output is 9
You may also be able to just cast the number to int:
int i = (int) 9.3f;
Answered by
0
Answer:
Use the round(), floor() and ceil() static methods in the Math class. round() will round to the nearest integer, whilst floor() will round down and ceil() will round up.
Explanation:
Similar questions