Unable to see the System.out.println("The value of the variable m is "+m);
the output in console
What is the error in the code please can you share
package Introduction;
public class Example {
public static void main(String[] args) {
// TODO Auto-generated method stub
long a = 12345;long b = 54321; long c = 5678; long d= 8765;
long m = a+b+c+d;
System.out.println("The value of the variable m is "+m);
float f = (a+b)/(c+d);
System.out.println("f = "+f);
float g = (a+b)/(c+d); System.out.println("g = "+g);
double h = (a+b)/(c+d); System.out.println("h = "+h);
double aa= 40.24; double bb=50.44; double i = aa+bb;
System.out.println("the value of i = "+i);
float cc= 40.24F; float dd = 50.44F; float k = dd-cc; System.out.println("the value of k = "+k);
System.out.println("The value of the variable m is "+m);
}
}
The console of the above is :
g = 4.0
h = 4.0
the value of i = 90.68
the value of k = 10.199997
The value of the variable m is 81109
--- Update ---
Hi,
I cant see the output of this command in the console
System.out.println("The value of the variable m is "+m);
Please can you share the error in this code
The code is :
package Introduction;
public class Example {
public static void main(String[] args) {
// TODO Auto-generated method stub
long a = 12345;long b = 54321; long c = 5678; long d= 8765;
long m = a+b+c+d;
System.out.println("The value of the variable m is "+m);
float f = (a+b)/(c+d);
System.out.println("f = "+f);
float g = (a+b)/(c+d); System.out.println("g = "+g);
double h = (a+b)/(c+d); System.out.println("h = "+h);
double aa= 40.24; double bb=50.44; double i = aa+bb;
System.out.println("the value of i = "+i);
float cc= 40.24F; float dd = 50.44F; float k = dd-cc; System.out.println("the value of k = "+k);
}
}
The console is:
f = 4.0
g = 4.0
h = 4.0
the value of i = 90.68
the value of k = 10.199997