Question 39 : Write a program in Java to find the absolute value of an integer given by the user.
Java Program :
class absolute
{
static void cal(int a)
{
int b=a>0?a:-a;
System.out.print("The absolute value of '"+a+"' : "+b);
}
}
Java Program :
class absolute
{
static void cal(int a)
{
int b=a>0?a:-a;
System.out.print("The absolute value of '"+a+"' : "+b);
}
}
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 hyderabad
ReplyDelete