Computer Science, asked by pragyapathak12, 1 year ago

write a program to input appropriate values and print the result
 \sqrt{a {}^{2} } + b {}^{2}
(in Java)

plz help

Answers

Answered by nain31
1
import Java. so. *;
class p
{
public static void main(String arts[])throws exception
{
DataInputStream in=new DataInputStream(System.in);
int a, b, c;
Sopln("enter the value of a and b");
a=Ip;
b=Ip
c=math.sqrt(a*a)+math. sqrt(b*b);
Sopln("the answer is "±c);
}
}

sopln--System. out. print
Ip=Integer.parseInt(in.readLine());

Hope it helps (。’▽’。)♡

pragyapathak12: thx
pragyapathak12: can you write this code in scanner class
pragyapathak12: plz
Similar questions