
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
Program to calculate area of Enneagon
An enneagon also known as nonagon is a polygon with 9 sides. To calculate the area of enneagon the following formula is used,
Area of ennagon = ((a2*9) / 4*tan (20°)) ∼= (6.18 * a2)
Code Logic, The area of a polygon with nine sides is calculated by using the formula, ((a2*9) / 4*tan (20°)) ∼= (6.18 * a2). The value 6.18 is filled into a float variable called multiplier, this value then multiplied by the square of side of enneagon.
Example
#include <stdio.h> #include <math.h> int main(){ int a = 6; float area; float multiplier = 6.18; printf("Program to find area of Enneagon
"); printf("The side of the Enneagon is %d
", a); area = (6.18 * a * a); printf("The area of Enneagon is %f
", area); return 0; }
Output
Program to find area of Enneagon The side of the Enneagon is 6 The area of Enneagon is 222.479996
- Related Articles
- Swift Program to Calculate the Area of Enneagon
- How to Calculate Area of Enneagon in Java?
- Program to calculate Area Of Octagon
- Swift Program to Calculate Area of Octagon
- Swift Program to Calculate Area of Hexagon
- Swift Program to Calculate Area of Pentagon
- Program to calculate area and perimeter of Trapezium
- Program to calculate the area of a Tetrahedron
- Java Program to calculate area of a Tetrahedron
- Swift Program to calculate the area of Cube
- Haskell Program to calculate the area of Cube
- Python Program to calculate the area of Cube
- Program to calculate area and perimeter of equilateral triangle
- Program to calculate area and volume of a Tetrahedron
- Python Program to calculate the area of a Tetrahedron

Advertisements