There are several ways to calculate print resolution, depending on the answer you want. Let's say you wanted to know the print size at 212 DPI for a digital image measuring 2048 x 1536 (3.1MP). You can simply divide the image's resolution by the print resolution (DPI) to give a final printed size in inches: 2048 pixels / 212 DPI = 9.66" and 1536 pixels / 212 DPI = 7.25". This means that if you print a digital image measuring 2048 x 1536 onto a paper measuring 7.5" x 10" (rounded), you will have a 212 DPI print.
If you need to know the size of a digital image for a specific print size and resolution, you can run this formula backwards. For example, let's say you wanted a 5" x 7" print with a print resolution of 300 DPI. All you need to do is multiply the print size by the print resolution: 5" x 300 DPI = 1500 pixels and 7" x 300 DPI = 2100 pixels. This means you need a digital image at least 2100 x 1500 pixels to get 300 DPI on a 5" x 7" print.