3

(1.7K
Views)

I know the mathematics formula for the area of the square. The formula is A=a^{2}. I want to create a program in C language to get the area of the square. I am a beginner in C language. How can I find the area of the square in C programming(Computer Language)?

arnabisaha (2.4K Points)

in C Language 2 Answers

0

Thanks for asking here. I really appreciate your learning way, This is the best way and create code in C Language. You want to find out the area of the square. The mathematics formula A =a^{2}.

Let's understand the area of the square formula.

Area of the square A= a^{2 }

A stands for the area.

a denotes the side.

a2 = Square of the sides.

Let's create a program using the C programming language. It will help to find out the area of the square easily in C language.

```
#include<stdio.h>
#include<math.h>
main()
{
float a=2.0;
float area;
area = a*a;
printf("Area of square = %.2f\n", area);
}
```

You can change the side value of the square.

Comment

arnabisaha 29 Oct 2019

vishalrana1(7.3K Points)

answered 0

C language is the basis of every programming language. If you are learning the C programming language, then it will be helpful for you. You can create a program in C language to find out the area of the square. As you that the mathematics formula for the area of the square is A=a^{2}.^{ }

How to find out the ara of the square-

First of all, create two variables like - float area, float a.

You need to define the value of a .

Multiply the value of the two times.

like -

`area=a*a; `

Now display the value of the area.

You will get the area of the rectangle.

Comment

Your Answer

You can post your answer after