Here’s one way of doing this. Use one cylinder, Shear an edge loop , make a copy, rotate the copy and connect the two:

Or, even easier: Shear the ‘top’ of a cylinder, Extrude it in X direction, then Extrude in Z,…
A Shear of 1, gives a 45° angle, you can Shear it less, extrude in a different direction (not exactly 90°) and make all sorts of variations.
Of course there are more ways to do this, but for your example this should work fine.