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

Mechassi 2

The document outlines a C++ program designed to calculate the area and centroid of a quarter circle based on a user-defined radius. It includes the necessary code and an example output for a radius of 3.5, resulting in a centroid at (14.6608, 14.6608) and an area of 9.62113. The program utilizes mathematical constants and functions to perform the calculations.

Uploaded by

netkerishi2764
Copyright
© © All Rights Reserved
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)
5 views2 pages

Mechassi 2

The document outlines a C++ program designed to calculate the area and centroid of a quarter circle based on a user-defined radius. It includes the necessary code and an example output for a radius of 3.5, resulting in a centroid at (14.6608, 14.6608) and an area of 9.62113. The program utilizes mathematical constants and functions to perform the calculations.

Uploaded by

netkerishi2764
Copyright
© © All Rights Reserved
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

Subject: Engineering Mechanics

Department: Engineering Science

Semester/Year: Sem-I/FYBtech.

 ❖To find Area, Centroid of Quarter Circle in C++ program.

1. PROGRAM:-

#include <iostream>

#include <cmath>

const double PI = 3.14159265358979323846;

double radius, area, x_coordinate, y_coordinate;

int main() {

std::cout << "Enter the radius of the quarter circle: ";

std::cin >> radius;

area = (PI * pow(radius, 2)) / 4;

x_coordinate = (4*radius)/3*PI;

y_coordinate = (4*radius)/3*PI;

std::cout << "The centroid of the quarter circle is at (" << x_coordinate << ", " << y_coordinate << ")"
<< std::endl;
std::cout << "The area of the quarter circle is " << area << std::endl;

return 0;

OUTPUT:-

Enter the radius of the quarter circle: 3.5

The centroid of the quarter circle is at (14.6608, 14.6608)

The area of the quarter circle is 9.62113

You might also like