write a program to find the area of a square by getting radius from the user
Answers
Answered by
4
import java.util.Scanner;
public class Area{
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
System.out.println("Area of the square is " + (x * x));
}
}
x = int(input())
print("Area of the square is " + str(x * x))
CLS
INPUT "", x
PRINT "Area of the square is " + str$(x * x)
END
#include <iostream>
using namespace std;
int main() {
int x;
cin >> x;
cout << "Area of the square is "<< (x * x)
return 0;
}
- We took input in variable x.
- Then multiplied x by itself.
- Then printed it concatenating with a String.
- And finished it....
Hope it helps...
Answered by
1
Explanation:
We took input in variable x.
Then multiplied x by itself.
Then printed it concatenating with a String.
And finished it..
Similar questions