Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CTriangle
- {
- int width;
- int height;
- void show_area(){
- System.out.println("area="+(width*height)/2);
- }
- }
- public class B10207081
- {
- public static void main(String args[])
- {
- CTriangle tr1,tr2;
- tr1=new CTriangle();
- tr2=new CTriangle();
- tr1.width=10;
- tr1.height=5;
- tr2.width=20;
- tr2.height=10;
- tr1.show_area();
- tr2.show_area();
- System.out.println("B10207081");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement