Anderson also wrote Hollywood screenplays, TV scripts and several novels, but it was his stage work that brought him the most fame.
He's best known for "Tea and Sympathy," a drama about the relationship between the wife of a headmaster at a New England prep school and a student suspected of being gay.
The play, which opened on Broadway in 1953, starred Deborah Kerr as the wife and John Kerr as the young man. Both actors repeated their roles in the 1956 film version, which featured a screenplay by Anderson and was directed by Vincent Minnelli.
Anderson's script contained an often quoted line, uttered by the wife to the student about their affair: "Years from now, when you talk of this — and you will — be kind."
His other big Broadway success was "You Know I Can't Hear You When the Water's Running," a collection of four one-act comedies, mostly about marriage, that opened in New York in 1967 and ran for more than 700 performances. Featured in the cast were Martin Balsam, George Grizzard, Eileen Heckart and Melinda Dillon.
Anderson's other major Broadway productions included "Silent Night, Holy Night" (1959), which starred Henry Fonda and Barbara Bel Geddes, and "I Never Sang for My Father" (1968) about a contentious father-son relationship. The cast included Hal Holbrook, Lillian Gish and Alan Webb.
His work in Hollywood included screenplays for "Until They Sail" (1957), "The Nun's Story (1959), for which he received an Academy Award nomination, and "The Sand Pebbles" (1966), a Steve McQueen epic set in 1920s China.
In 1970s, Anderson turned to writing novels: "After" (1973) and "Getting Up and Going Home" (1978), and he also wrote extensively for television.
Born April 28, 1917, in New York, Anderson went to Harvard. He served as a lieutenant in the Navy in the Pacific during World War II. After the war, he studied with John Gassner at the New School's Dramatic Workshop. Anderson's first Broadway effort was contributing to a short-lived revue "Dance Me a Song" (1950), whose cast included Wally Cox and Bob Fosse.
A memorial service is planned for Friday.