When McKinley was president, from 1896 until he was assassinated in 1901, there were 45 states in the union - resulting in 45 stars on the U.S. flag. The next one wouldn't be added until the addition of Oklahoma in 1907.
James K. Polk served as the eleventh President of the United States between March 4, 1845 and March 4, 1849. There were 26 stars on the United States flag between March 4, 1845 and July 3, 1846. There were 27 stars on the flag between July 4, 1846, and July 4, 1849, and there were 28 stars on the flag between July 4, 1849 and the end of James K. Polk's term as President.
45 stars from 1901 to 1907, then a 46th star was added for Oklahoma.
The 13 stars of the original colonies
There were 39 stars on the US flag
The "White Flag Fleet"
If you mean stars in the US flag, 45 states were state when he entered office and one more became a state while he was in office. They don't always update the flag as soon as a state was included in the union so it may have still had 45 stars when he finished his last term.
When Thomas Jefferson was president there were fifteen stars ont the flag.
The US flag had 31 stars while Pierce was President.
During the term of Franklin Delano Roosevelt from 1933-1945, the US flag displayed 48 stars; the flag with 48 stars was the official flag from 1912-1959.
There were 50 states, and 50 stars on the flag, when Jimmy Carter became president.
There were 15 stars in the American flag while George Washington was president.
The U.S. flag had 48 stars from July 4, 1912 until July 4, 1959.
13 stars for 13 states.