+ 1
Plzz make a program that input and output is
input: 25.7657 output: 25 .7657
6 Answers
+ 30
public class Program{
public static void main(String[] args){
double a=123.543;
int b=(int)a;
/*since double to int type is an explicit type conversion, so we need to use cast operator to convert double value to integer value
it will not round it off , but it will just remove the decimal part */
System.out.print(b+"\n"+(a-b));
}
}
/*
(int) is used to cast double value to an integer value
//ie b will be 123
//(a-b) will give 123.543 - 123 that is .543
//"\n" is user for taking text or value to a next line
//hope it helps âș
*/
+ 2
bhai can u make it this program with simple method I mean without using scanner,buffer reader etc make it with impure function plxxzzzzzz
+ 2
to plzzz bhej do
+ 2
thnx bro n can u also explain why we use this????
+ 1
thnxxxx bro
0
Explain is clearly written in the comments , can you didn't understand simple English.