Additional secrets to longevity include displaying a good level of middle-age fitness, having a mother who has lived a long time and owning a property by the age of 50 (as it indicates a higher standard of living).
The tips come from scientists at the University of Gothenburg who analysed data on 855 Swedish men born in 1913, including 10 who celebrated their 100th birthday.
They found that 27% of the study participants survived to the age of 80 and 13% to 90.
Of all the deaths occurring after the age of 80; 42% were attributed to heart disease, 20% to infection, 8% to stroke, 8% to cancer, 6% to pneumonia, and 16% to other causes.
Dr Lars Wilhelmsen, who has been involved in the study for the past 50 years, said: "The unique design has enabled us to identify the factors that influence survival after the age of 50.
"Our recommendation for people who aspire to centenarianism is to refrain from smoking, maintain healthy cholesterol levels and confine themselves to four cups of coffee a day."
Surveys at ages 54, 60, 65, 75, 80 and 100 allowed the scientists to highlight factors that promoted longevity.
"Our findings that there is a correlation with maternal but not paternal longevity are fully consistent with previous studies," Dr Wilhelmsen added.
"The genetic factor appears to be a strong one - but still we found that this genetic factor was weaker than the other factors. So factors that can be influenced are important for a long life."
Two of the centenarians dropped out of the study due to dementia and one for personal reasons.
Of the remaining seven, two lived at home and five in assisted facilities. None smoked, and all displayed good temporal and spatial cognition which involves a sense of time and space.
In addition, despite universally using walking frames, every 100-year-old was slim and had a good posture.
"Normally we conducted the surveys at hospitals, but we visited the seven centenarians at home," said Dr Wilhelmsen. "All of them were clinically healthy, satisfied with their circumstances and pleased to be living where they were."
The findings appear in the Scandinavian Cardiovascular Journal.