• Register
Welcome to Techno Smarter QA, Questions, Answers Community
Welcome to Techno Smarter Q&A, where you can ask questions and receive answers from other members of the community. Ask the tech & programming Question that you want. Guests Posting are allowed.
+2 votes
15 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)? 

 

in C Language by (1.8k points) 1 5 26

2 Answers

0 votes

Thanks for asking here. I really appreciate your learning way, This is the best way and creates 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.

by (7.1k points) 4 20 46
edited by
Thanks for sharing this valuable information. I got the area of square in C language.
0 votes

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 are 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. 

 

by (5.1k points) 4 15 45
...