This document contains the slides from a presentation on various C programming concepts and examples including:
- A program to calculate shear force and bending moment in a cantilever beam at different distances from the fixed end.
- Programs to calculate total head of flow through a pipe, add two matrices, and print a multiplication table.
- Examples of using decision making (if/else statements) to determine if a number is even or odd, and using operators to convert days to months.
The presentation provides explanations and step-by-step workings for each programming problem and example.
3. PROGRAM01
PROGRAM02
PROGRAM03
PROGRAM04
PROGRAM05
PROGRAM06
W
L
P
A cantilever beam is shown in the upper figure.
Write a C program to compute shear and moment
of the beam at every L/N distance from the free
end.
Here,
Length of the beam, L = 79+10= 89 feet
Concentrated Load, P = 79+13= 82 lbs
Uniformly Distributed Load, W = 13 lbs/feet
N = 100+79= 179
PROGRAM07
17. PROGRAM01
PROGRAM02
PROGRAM03
PROGRAM04
PROGRAM05
PROGRAM06
PROGRAM07
• To print this multiplication table, a single
for loop would be adequate.
• Initially value of the variable n should be
taken 2, as we are printing the
multiplication table of 2.
• The statement for loop will be like this,
for(i=0;i<=10;i++)
• Initially the value of i will be taken 1 and
It will execute the loop as long as the
value becomes equal to 10.