All about bscs
Home
Learn
_Courses
__Core Courses
__Computer Courses
__Elective Courses
_Linked List
_CS Courses
_Android Source Codes
Mega Menu
Home
How to find area of equilateral triangle in C C++ language
How to find area of equilateral triangle in C C++ language
Unknown
May 29, 2018
A triangle is said to equilateral triangle if its all three sides are equal and its all three angles at the same degree '60 degree'. User just need to find length of its one side and area will be calculated easily.
C Code
#include
#include
#include
main() { int side; float area; area= sqrt(3) / 4; printf("\nEnter the Length of Side : "); scanf("%d",&side); area = area*side*side; printf("Area of Equilateral Triangle %f",area); getch(); }
C++ Code
#include
#include
#include
using namespace std; int main() { int side; float area; area= sqrt(3) / 4; cout<<"Enter the Length of Side : "; cin>>side; area = area*side*side; cout<<"Area of Equilateral Triangle is : "<
Working of Program:
When the above code is compiled and executed user needs to input length of one side.In the next line formula will be applied and result will be stored in area variable.And finally result will be displayed to the user.
Output:
Reactions
Facebook
Twitter
Post a Comment
0 Comments
Popular Posts
Basic Electronics For BS Program
Calculate tabulation method using C/C++ DLD
Introduction to computing for BS Program
Computer Communications and Networks For BS Program
Calculus and analytical geometry for bs program
Programming fundamentals For BS Program
Object Oriented Programming For BS Program
Introduction to Software Engineering For BS Program
Computer Organization and Assembly Language for BS Program
Operating Systems for BS Program
Facebook
Categories
Android Source codes
1
Basic Courses
3
C basic
2
C Language
1
C++
6
circular linked list
4
computer cources
2
Core Courses
5
CS ourses
4
Data Structures
2
Database
1
Elective Courses
4
javafx
1
linked list
3
Math Courses
1
Mathematics
1
Queue
1
Tags
Android Source codes
Basic Courses
C basic
C Language
C++
circular linked list
computer cources
Core Courses
CS ourses
Data Structures
Database
Elective Courses
javafx
linked list
Math Courses
Mathematics
Queue
Search This Blog
July 2020
1
June 2018
6
May 2018
15
April 2018
16
October 2017
2
September 2017
8
0 Comments