1.
Write valid statements for the following in Java:
i. Print the absolute value of -9.99
ii. Print the largest of -45 and -50
iii. Print the smallest of -56 and -57.4
Iv. Print a random integer between 50 and 70
Answers
Answered by
2
Answer:
ii.-45
iii.-56
Explanation:
i know this
Answered by
2
Answer:
It's easy. "let me help, let me help you."
:)
ii) class Greater
{
void display largest integer()
{
int a=-40;
int b=-50;
int lar;
lar=a;
if(lar<b)
lar=b
system. out.print("\n largest no:"+lar)
}
}
iii) class smaller
{
void display smallest ()
{
int a= -56;
int b= -57.4;
int sma;
sma= b;
if(sma>a)
sma=a;
system. out.print( "\n smallest no:"+sma)
{
{
P.S: The first one was confusing.
Similar questions