President Carter told Congress yesterday that he will veto an appropriations measure that would prohibit the federal government from initiating court suits or other actions to force busing of students to achieve school desegregation.

In an action that clearly set him apart from President-elect Ronald Reagan, who has endorsed the controversial measure, Carter said the "unprecedented prohibition" in the legislation would set a "danagerous" precedent, threatening presidential powers in a number of areas. He also threatened to veto any continuing resolution passed by Congress to keep the government functioning in the absence of new appropriations if it contains the antibusing language.

"I cannot allow a law to be enacted which so impairs the government's ability to enforce our Constitution and civil rights acts," the president said in a letter to congressional leaders of both parties.

White House press secretary Jody Powell said Carter would veto the measure today, a step that could complicate Congress' rush to adjourn this week.

Powell and other White House officials said there is "a good chance" to sustain the veto. The antibusing provision, apart of the $9.1 billion appropriations bill for the Justice, State and Commerce departments for the current fiscal year, was adopted by the Senate 49 to 42, less than the two-thirds majority necessary to override a veto. The entire measure, including the antibusing provision, passed the House by 240 to 59.

Powell said the dispute can be settled "very simply " by passage of a continuing resolution that does not contain the antibusing provision.

Continuing resolutions are legislative measures Congress enacts to allow government departments and agencies to continue to spend money while they are awaiting passage of appropriations bills for the new fiscal year. Currently, most government agencies, lacking their own appropriations, are operating under such a resolution, which expires Dec. 15. A new resolution to extend the government's spending authority through much of next year has passed the House and is awaiting action in the Senate.

But this resolution also contains the antibusing provision and is also targeted for a veto if adopted in its current form. "My opposition also applies to the inclusion of such a provision in the continuing resolution," Carter said in his letter.

The president's threat to veto the continuing resolution was clearly designed to put added pressure on a Congress now bent on going home. Unless the veto of the appropriations bill is overridden, Congress faces the prospect of backing down on the issue or leaving town without having provided authority for the federal government to continue to function beyond Dec. 15.

Before Carter's message was delivered yesterday, Senate Democratic leaders divided on the advisability of a veto. Majority Leader Robert C. Byrd of West Virginia said he urged the president to sign the measure because the veto would not end antibusing attempts and there were other important provisions in the bill. But Majority Whip Alan Cranston of California called a veto "appropriate."

The president, who hosted a private lunch for black civil rights leaders yesterday, had been expected to veto the bill. He is proud of his record in civil rights enforcement and he differs sharply with Reagan over how much the federal government should be involved in such activities.

But in his letter to the congressional leaders yesterday, Carter framed his objections in constitutional rather than civil rights terms.

Citing his "often-stated belief that busing should only be used as a last resort in school desegregation cases, "Carter said:

"Busing is not the real issue here. The real issue is whether it is proper for the Congress to prevent the president from carrying out his constitutional responsibility to enforce the Constitution and the laws of the United States."

The president argued that accepting the antibusing rider "would permit a serious encroachment on the powers of this office," and said:

"The precedent that would be established if this legislation became law is dangerous. It would effectively allow the Congress to tell a president that there are certain constitutional remedies that he cannot ask the courts to apply. If a president can be barred from going to the courts on this issue, a future Congress could by the same reasoning prevent a president from asking the courts to rule on the constitutionality of other matters upon which the president and the Congress disagree."