![]() |
Area of rectangle using C programming |
Summery
Today in this post we learn that how we measure the area of rectangle formula using C programming. Basically today we will create a C program where we can measure the area of rectangle.
About Us
My Name is Sheikh Gulzaar. I studied in BCA (bachelor in computer application). Create this blog to provide my personal tips and tricks about various type of programming language. Any visitor can join us free and learn programming language with us. Any one can also clear their doubts by sending message in live chart option which is in under right corner. So keep supporting & keep learning.
Main Topic
First play this video and watch then you read this post, if you skip this video then may be you don't understand that how to measure the area of rectangle using C programming.
In this topic where we create a C program and measure the area of rectangle. After complete this program when we run this on terminal it ask to enter the length of rectangle and when we enter then it ask to enter the width and when we enter the value and press enter then it will show the area of rectangle.
Here is the example that how this program run and provide us the perfect area of triangle.
![]() |
Area of rectangle us C program |
How To Create
You can see this how the C program works as you can see the picture. And now we learn how you can create this. So now lets get start.
#step-1
At fast we have to open our compiler whether you can use pc or android. In computer or laptop Vs code is the best option and in android Cppdroid is the best option for C programming. So now open code editor or compiler then type the basic instruction.
i.e,
#include <stdio.h>
int main() {
// your program start here //
return 0;
}
This is the basic instruction. Then you can follow as same as the picture as you can see by the end of this paragraph.
![]() |
Area of triangle code |
Here is the given picture. You can type as same as you can see. Or we can also provide the above code in step-2 you can copy the code directly and paste in your compiler.
#Step-2
Here we provide the above code you can copy directly to your clipboard.
#include <stdio.h>
int main() {
// here is the value of variables
int height, width;
// here is the question which you want to ask someone
printf("Enter thr height of triangel \n");
scanf("%d", &height);
printf("Enter the width of triangel \n");
scanf("%d", &width);
//here is your final word where you can see the answer
int area = height*width;
printf("Here your area of triangel is %d \n", area);
printf("\n");
// author credits //
printf("\tProgram by Gulzaar Programs");
return 0;
}
Just copy the above code and paste it in your compiler and run this code and you can see the same things which you can see the first picture.
#Step-3
Or you can also download this code in your device. We always provide multiple option to save the code only to perform better.
Tap the download button and and download your code.
Now we will go to end this topic. If you have any doubt then you can contact us live in our live chart option as you can see the green logo which will in the under-right corner of the screen.