(Inside Science TV) -- No matter what you do to stay in shape, physical activity can help prevent obesity and many of the illnesses associated with it.
Now, a study found that regular physical activity might also help the brain function better as it reaches middle age.
"This study is yet another reason to live a very good lifestyle," said David Jacobs, an epidemiologist at the University of Minnesota in Minneapolis.
It turns out that leading an active lifestyle in your 20s, could improve your memory and thinking skills later in life.
Participants in the study were tested on their executive function, for example did they have the self-control to raise their hand before blurting out the answer to a question, and coordination skills using colored cards and a series of numbers.
Participants who were fit were on average four seconds quicker to read out the correct colors on the executive function test, and they were able to more accurately substitute symbols for numbers.
"We found that the people who were more fit actually had better thinking skills, they did better on the cognitive tests," said Jacobs.
In the study, researchers examined the lifestyles of over 2,700 men and women across 25 years. They found that the individuals who did better on treadmill tests in their 20s tended to do better on memory and problem solving tests in their middle-aged years.
The kinds of tests performed in the study are among the best predictors of developing dementia in old age. According to one study, every additional word remembered in the memory test was associated with an 18 percent decreased risk in developing dementia.
"For everybody, just moving around … seems to have some influence on thinking skills 25 years later," Jacobs said.
Even if you didn't commit to regular exercise when you were young doesn't mean all is lost; a healthy lifestyle can start at any age.
"Wherever you are in your life, if you became just a little bit more active, you probably would be better," explained Jacobs.