A steel beam is supported by two concrete pillars. The beam has a length of 10 m and a weight of 5 kN. The pillars are 1 m apart. Determine the reactions at the pillar supports. in C++

C++
x
18
#include <iostream>
using namespace std;
int main() {
float L, W, a, R1, R2;
L = 10; // Length of beam in m.
W = 5; // Weight of beam in kN.
a = 1; // Distance between pillars in m.
R1 = (W * L) / (2 * a); // Reaction at pillar 1.
R2 = (W * L) / (2 * a); // Reaction at pillar 2.
cout << "The reaction at pillar 1 is " << R1 << " kN." << endl;
cout << "The reaction at pillar 2 is " << R2 << " kN." << endl;
return 0;
}
🤖 Code Explanation
The code calculates the reaction at pillar 1 and pillar 2 for a given beam.

More problems solved in C++


















