This looks like Excel coding for a cell. A blank cell could be a blank text cell or a blank numerical cell. If the cell format has been specified by the user as a numerical cell, blank cell may be interpreted by Excel as 0. If the cell is unspecified or specified as a text cell, you cannot necessarily perform arithmetic on a text cell, unless the Excel version you are using interprets text data that looks like a number as a number. You cannot rely on this, and it's unsafe to do so. Other formats for the cell may also have a default meaning. For example, a blank date cell may be treated as 1/1/1900, and a numerical value of zero date may be inserted by default. If D4 is numerical and C4 is unspecified and blank, the software may well insert a blank for the cell carrying the IF function. Sometimes Excel will insert an error flag #VALUE? or something like that if it can't understand your intention and doesn't want to second guess any particular interpretation. To be absolutely certain everything is properly interpreted, the IF statement should make specific allowance for blank cells by testing for NULL or 0. The best solution is to experiment with a more concise and comprehensive conditional statement so that your are certain to cover all eventualities.
Even if this question doesn't relate to Excel, it looks like it is nevertheless coding for some application, and the same rule applies: make conditional statements precise so as to cover all eventualities. Never think that any software matches human reasoning!