double[] arrayName = new double[10];
arrayName[0] = (14/49)*100;
Trying to get percentage of two numbers, 14 / 49, and add results to an array. All it returns is 0.0. Same thing if I use float instead of double. New to Java.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Either cast the
ints todouble, or just usedoubles.For example:
or: