(Java) - how to display the output we set -
this java code, how can display example:
public static void main(string[] args) { // todo code application logic here int = 1; int j = 1; (i = 1 ; <= 10; i++) { (j = 1; j<= 5; j++) { if (i % 2 == 0 ) { system.out.println ( j + "/5 = " + /10.0); //the output should // 1/5 = 0.2 // 2/5 = 0.4 // 3/5 = 0.6 // 4/5 = 0.8 // 5/5 = 1.0 } } } system.out.println("--------------------"); } }
how can display output 1/5 = 0.2 2/5 = 0.4 3/5 = 0.6 4/5 = 0.8 5/5 = 1.0
you're doing way here. this:
public static void main(string[] args) { (int = 1; i<= 5; i++) { system.out.println ( + "/5 = " + / 5.0); } system.out.println("--------------------"); }
output:
1/5 = 0.2 2/5 = 0.4 3/5 = 0.6 4/5 = 0.8 5/5 = 1.0 --------------------
Comments
Post a Comment