Computer Science, asked by uttammazumdar, 7 days ago

write a program to find the area of a square by getting radius from the user​

Answers

Answered by purveshKolhe
4

\huge{\green{\overbrace{\underbrace{\purple{\mathfrak{answer::}}}}}}

\sf{\underline{Java--}}

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));

  }

}

\sf{\underline{Python--}}

x = int(input())

print("Area of the square is " + str(x * x))

\sf{\underline{QBASIC--}}

CLS

INPUT "", x

PRINT "Area of the square is " + str$(x * x)

END

\sf{\underline{C++}}

#include <iostream>

using namespace std;

int main() {

  int x;

  cin >> x;

  cout << "Area of the square is "<< (x * x)

  return 0;

}

\red{\mathfrak{Logic::}}

  • 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 kauranmolpreet395
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