Yes, but the "curse" applies - in theory - to people who were merely elected in at least one year ending in 0. Every president who was elected in at least one of his campaigns in a zero-ending year from 1840 to 1960 has died in office.
Harrison - 1840 - illness
Lincoln - 1860 - assassin
Garfield - 1880 - assassin
McKinley - 1900 - assassin
Harding - 1920 - illness
Roosevelt - 1940 - illness
Kennedy - 1960 - assassin
Reagan - 1980 - avoided the assassin and supposedly broke the curse of Tippicanoe as it is called. Of course it's all superstition, but it did hold "true" for 120 years.
Two pistols and in both tries the cap went off but not the powder. Jackson beat the man with his cane.