write a java program to find the area of square
by using input stream
use the method of input stream
Answers
Answered by
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
1
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
Math,
4 hours ago
Math,
4 hours ago
Math,
7 hours ago
English,
7 hours ago
India Languages,
7 months ago
Science,
7 months ago
Social Sciences,
7 months ago