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.
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.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online from Scribd
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.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online from Scribd