Write a program in java to calculate area of a triangle

No comments
import  java.util.*;
import  java.lang.*;
class  triangle
{
public  static  void  main (String  obj [ ])
    {
       int a, b, c, s, tri ;
Scanner  sc=new  scanner (system.in);
System.out.println (“Enter  the  value of  a,  b,  c”);
a=sc  nextInt ();
b=sc  nextInt ();
c=sc  nextInt ();
s=sc  nextInt ();
tri = math.sqrt (s*(s-a)*(s-b)*(s-c));
system.out.println (“Area  of  triangle  is=”+tri);
     }
}

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀