import java.io.*;
class Ternary
{
public static void main(String args[]) throws IOException
{
int num,k;
System.out.println("Enter a number");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
num=Integer.parseInt(br.readLine());
k = num < 0 ? -num : num; //get absolute value of num
System.out.println("Absolute value of "+num+" is "+k);
}
}
I like your post very much. It is very much useful for my research. I hope you to share more info about this. Keep posting java online training india
ReplyDelete