X=25/10 how to excute in java
how to excute in java
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Gall Anonim #10897794
19 August 2022, 10:03
x - must be double
25 or 5 must be double
and must be wiritten like this 25.0/10 or 25/10.0 then x will be 2.5
if x will be doble and 25 and 5 will be int, x will be 2
0
Biswabidit prusty
19 August 2022, 04:42
public class Program
{
public static void main(String[] args) {
int x=25/10;
System.out.println(x);
}
}
//It will gives output an integer value which 2. The output will change according to the data type.
0
Daan Lacroix
18 August 2022, 21:45
i think you either mean:
int x = 25 / 10
or
x = 25 / 10
depending on if x is already declared
0