Diagonal lines can appear zig-zagged because angles, like the rest of a digital photo, are made up square pixels. Jaggies are most noticeable when lines are in high contrast to the background such as a roofline against a clear sky.
One solution when photographing subjects with strong angles is to take photos from a different position or change your distance to the subject. Also make sure your digital camera is set to its highest resolution.
Jaggies are more apparent in low resolution photos since less pixels make up the image.
Image editing, printing and the jaggies
Jaggies are made more noticeable by sharpening.
Many compact digital cameras automatically sharpen an image at the time it is taken. Others have a setting to reduce in-camera sharpening or shut it off completely. If you have the option, reduce in-camera sharpening when taking photos with strong angles.
In image editing programs, the effect of jaggies can be minimized by using an anti-aliasing setting. Anti-aliasing evens out jagged lines by surrounding the jagged pixels with shades of colored pixels (or shades of gray for black and white images). While anti-aliasing reduces the jagged appearance of lines, it may make a photo appear fuzzier.
Most printers automatically reduce jaggies via a technique known as smoothing. Some printer software and drivers let you reduced the jaggies further by selecting Photo Noise Reduction and/or Image Optimizer settings.