Showing posts with label Area of Square. Show all posts
Showing posts with label Area of Square. Show all posts

Sunday, June 19, 2022

Area of Square - JAVA PROGRAM

Area of Square 

Problem Statement
Given a side of a square, your task is to calculate its area. Input The first line of the input contains the side of the square.

Constraints: 1 <= side <=100 

Output You just have to print the area of a square

Example Sample Input:- 3
 Sample Output:- 9 

 Sample Input:- 6 
 Sample Output:- 36


import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework

// don't change the name of this class
// you can add inner classes if needed
class Main {
    public static void main (String[] args) {

       Scanner sc = new Scanner(System.in);
 int a = sc.nextInt();
 System.out.println(a*a);


    }
}

ads vert

Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody

  Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody < table >      < thead >    ...