Inflation rose for a second consecutive month as the U.S.-Israeli war with Iran continued to send gasoline prices surging in April, government data on Tuesday showed.