Computer Science, asked by shashi007, 1 year ago

6.WAP to find the perimeter of a triangle with sides measuring 10cm, 14cm, 15CMIN JAVA ONLY.

Answers

Answered by rajkamal4
0
import java.io.*;
class Triangle
{
public static void main ()
{
int a,b,c,p;
a=10;
b=14;
c=15;
p=a+b+c;
System.out.println("Perimeter of triangle is="+p);
}
}
Answered by stylishtamilachee
1

Answer:

public class Calc

{

public void compute( )

{

int side1 = 10, side2 = 14 , side3= 15 ;

int perimeter;

perimeter = side1 + side2 + side3 ;

System.out.println("Perimeter of triangle with sides 10cm, 14cm and 15cm is" + perimeter + "cm") ;

}

}

Output:

Perimeter of triangle with sides 10 cm, 14 cm and 15 cm is 39 cm

Java:

Java is a popular third-generation programming language, which can be used to do any of the thousands of things that a computer software can do. With the features it offers, Java has become the language of choice for internet and intranet applications. Java plays an important role for the proper functioning of many software-based devices attached to the network.

Similar questions