TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Simple Area & Perimeter of Rectangle Program in Java
Alagunila Meganathan
Aug 10
2016
Code
579
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
RecArea.rar
import
java.io.*;
class
RecArea {
public
static
void
main(String[] args) {
int
l=
0
;
int
w=
0
;
try
{
BufferedReader br1 =
new
BufferedReader(
new
InputStreamReader(System.in));
System.out.println(
"Enter length of rectangle : "
);
l = Integer.parseInt(br1.readLine());
System.out.println(
"Enter width of rectangle : "
);
w = Integer.parseInt(br1.readLine());
int
area = l*w;
System.out.println(
"Area of Rectangle : "
+area);
int
perimiter =
2
*(l+w);
System.out.println(
"Perimeter: "
+ perimiter);
}
catch
(Exception e){System.out.println(
"Error : "
+e);}
}
}
java
Area
Rectangle