1. make a pr0gram that will display the qu0tient of three variables. if the first variable is 50 sec0nd variable will have the value of half the first variable and the third variable will have the value of half the sec0nd variable? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

1. make a pr0gram that will display the qu0tient of three variables. if the first variable is 50 sec0nd variable will have the value of half the first variable and the third variable will have the value of half the sec0nd variable?

java program

8th Jul 2016, 2:38 PM
theniel
3 Answers
0
or you can use for loop also
8th Jul 2016, 8:11 PM
Ravi Jain
Ravi Jain - avatar
0
No need to complicate it so much. It's simple: double x = 50; need half that so new variable double y = x/2; Then you need half of that so double z = y/2; Keep it simple :)
9th Jul 2016, 1:48 AM
James
James - avatar
- 1
public static void main (String []args){ double x=50.0; findingHalf(x); } public static void findingHalf (double n){ System.out.println (n); n=n/2; findingFirstHalf (n); } public static void findingFirstHalf (double i){ System. out.println (i); i=i/2; findingSecondHalf (i); } public static void findingSecondHalf(double m){ System. out.println (m); m=m/2; }
8th Jul 2016, 3:07 PM
milada
milada - avatar