Logo

2.4K views Asked 28 Oct 2019 in C Language
3

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

User arnabisaha (2.5K Points)

2 Answers
0
shakti (9.5K Points)

answered 28 Oct 2019 (edited)

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.

 


Thanks for sharing this valuable information. I got the area of square in C language.  –  arnabisaha 29 Oct 2019
Add comment

0
vishalrana1 (7.4K Points)

answered 28 Oct 2019

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. 


🚀 Build Your Own Q&A Community Website

This live website is powered by Techno Smarter QA. The complete source code is now available with a powerful admin panel, responsive design, future updates, and support.

Admin Panel Responsive SEO Friendly PHP
Get Source Code

Your Answer
×
Login Required

You must login to continue.

Login Login with Google
Register