Computer Science, asked by bondbaking74, 7 hours ago

write a java program to find the area of square
by using input stream
use the method of input stream​

Answers

Answered by Kalihacker
1

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner read=new Scanner(System.in);

System.out.print("Enter the edge lenght: ");

Integer side=read.nextInt();

Integer area=side*side;

String out=String.format("The area is %s",area);

System.out.println(out);

}

}

Answered by purveshKolhe
1

  \overbrace{\underbrace{ \green{ \boxed{ \red{ \mathfrak{answer \: : }}}}}}

Program::

import java.util.Scanner;

public class Brainly {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int x = sc.nextInt();

System.out.println("Your answer is -- " + (x * x));

}

}

Reasoning::

==> Asks for the input and multiplies the number by itself.

==> Yeah, the program is finished.

Hope this helps you..

Similar questions