- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

A square is a rectangle whose length and breadth are same. Therefore, Area of a rectangle is the square of its length. so, to calculate the area of a square

- Get the length of the square form the user.
- Calculate its square.
- Print the square.

import java.util.Scanner; public class AreaOfSquare { public static void main(String args[]){ int length, area; Scanner sc = new Scanner(System.in); System.out.println("Enter the length of the square ::"); length = sc.nextInt(); area = length* length; System.out.println("Area of the square is ::"+area); } }

Enter the length of the square :: 55 Area of the square is ::3025

- Related Questions & Answers
- Java program to find the area of a rectangle
- Java program to find the area of a triangle
- Java program to find the area of a circle
- Java program to find the square root of a given number
- Program to calculate the area of an Circle inscribed in a Square
- Program for Area Of Square in C++
- Program to find area of largest square of 1s in a given matrix in python
- Area of a leaf inside a square in C Program?
- Area of a leaf inside a square?
- Python Program to find the area of a circle
- 8086 program to find the square root of a perfect square root number
- C Program for Program to find the area of a circle?
- Program to find the Area of a Parallelogram in C++
- Program to find the Area of a Pentagon in C++
- 8085 program to find square root of a number

Advertisements