×

Please Login or Register to continue.

3
(1.7K Views)

I know the mathematics formula for the area of the square. The formula is A=a2. 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)? 

(2.4K Points)
in C Language

Share

2 Answers
(9.4K Points)
(edited)
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 =a2

Let's understand the area of the square formula.    

Area of the square A= a

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
Thanks for sharing this valuable information. I got the area of square in C language.
arnabisaha 29 Oct 2019

(7.3K Points)
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=a2. 

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

Related Questions :-

Your Answer

You can post your answer after login..