0% found this document useful (0 votes)
47 views2 pages

Area Circle #Include #Include

This document contains code for calculating the area of two shapes - a circle and a triangle. For the circle, the code prompts the user to input a radius, then calculates the area as pi * radius squared and displays the result. For the triangle, the code prompts the user to input a base and height, calculates the area as 0.5 * base * height using the triangle area formula, and displays the result.

Uploaded by

farhanHE
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views2 pages

Area Circle #Include #Include

This document contains code for calculating the area of two shapes - a circle and a triangle. For the circle, the code prompts the user to input a radius, then calculates the area as pi * radius squared and displays the result. For the triangle, the code prompts the user to input a base and height, calculates the area as 0.5 * base * height using the triangle area formula, and displays the result.

Uploaded by

farhanHE
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

AREA CIRCLE #include <iostream.h> #include <conio.

h>

int radius; double area;

main() { cout<<"Insert your radius : "; cin>>radius;

area=3.142*radius*radius;

cout<<"Your Area is "<< area;

getch(); }

AREA TRIANGLE #include <iostream.h> #include <conio.h>

int base,height; double area;

main() { cout<<"Insert your base : "; cin>>base;

cout<<"Insert your height : "; cin>>height;

area=0.5*base*height;

cout<<"Your Area is "<< area;

getch(); }

You might also like