Apple co-founder Steve Wozniak's formula for happiness doesn’t have anything to do with money

Steve Wozniak speaking at eMerge in Miami on June 12, 2017.

Steve Wozniak has a formula for happiness, and it doesn't involve money. In fact, he's been using it since before he co-founded Apple: "'Smiles minus frowns' was my original formula when I was about 20 years old," says Wozniak, who appeared on CNBC's Squawk Box on Monday.

The "smiles" part of the equation means doing things that make you happy, following things that make you happy and having a lot of entertainment in your life, Wozniak says.

"Create jokes, create humor everywhere you go," he says. "Pranks are created jokes, for example."

Steve Jobs and Steve Wozniak, co-founders of Apple, in 1977.
Getty | Tom Munnecke

Wozniak says he and Steve Jobs used to pull a lot of pranks back in the day. For example, when they were building "blue boxes," devices which allowed people to make long-distance phone calls for free, Wozniak rang up the Vatican, saying he was Secretary of State Henry Kissinger calling on behalf of President Richard Nixon. And Jobs says it was — one in which they rigged a sign that gave the graduating class the finger — that sealed his friendship with Wozniak.

"That keeps you happy," Wozniak tells Squawk Box.

The other part of the formula is just as important: Avoid frowns. "Don't be bothered when things don't go your way," Wozniak explains. "Just think out how to be constructive."

That advice sounds a lot like "Option B" co-author Adam Grant's theory of resilience. "I don't think there's any skill more critical for success," Grant tells CNBC.

"I think about resilience as the speed and strength of your response to adversity. So when you encounter a difficulty, a hardship, a challenge, how quickly and how effectively are you able to marshal strength and either overcome that challenge or persevere in the face of it?"

Wozniak says he's particularly good at this: "Don't waste your time blaming people and being all upset, because those feelings destroy your psychology."

Don't miss: The first project Steve Jobs and Steve Wozniak worked on was a high school prank

Tony Robbins identifies the trait Branson, Jobs and Gates have in common
Tony Robbins identifies the trait Branson, Jobs and Gates have in common