Slate and Co. Senior Executive Cliff Vandercave and secretary Miss Sharon Stone discuss their plan to swindle the company of its vast fortune and flee, and that they need one of their employees to be responsible for it. Fred Flintstone loans his best friend and neighbor Barney Rubble money so that he and his wife Betty can adopt a child named Bamm-Bamm, who can only pronounce his own name. Although the child is initially difficult to control due to being raised by Mastadons, as well as having super strength, he eventually warms up to his new family. Barney vows to repay his friend, but Fred is visited by his mother-in-law, Pearl Slaghoople, who objects to his decision. However, Fred's wife Wilma remains supportive of his decision.
Cliff holds an aptitude test, where the worker with the highest mark will become the new Vice President of the company. Barney gets the highest score, but remembers his promise and switches his paper with Fred, who he knows will fail miserably. Fred receives the promotion, but his first order is to dismiss Barney, since Barney now effectively has the lowest score. Fred accepts, but does his best to help Barney support his family, even inviting the Rubbles to live with them so that they can rent out their home. However, the perks of Fred's new job put a strain on relationships, as Wilma catches him in an intimate moment with Miss Stone, and the Rubbles are annoyed by Fred and Wilma's increasingly snobbish behavior. Cliff eventually tricks Fred into sacking the workers, over the objections of his office Dictabird. At a local restaurant Barney confronts Fred after seeing worker riots on the news revealing that he switched tests with Fred, and the Rubbles move out, despite having nowhere to live. Wilma and Pebbles also move out to her mother's house, leaving Fred behind.
Fred goes to the quarry and realizes his mistake and Cliff's plot, but also finds out that Cliff has tricked Fred into thinking that he embezzled the money, Fred attempts to get Mr. Slate to fire Cliff, but Cliff calls the police. A manhunt for Fred ensues by the police and the workers. Wilma and Betty see this on the news, and break into Slate and Co. to get the Dictabird, the only witness who can clear Fred. They are, however, unaware that Cliff saw them from his office window. As Fred attempts to infiltrate a cave where the workers are seeking refuge, they see through his disguise and attempt to hang him. Barney shows up, now working as a snow cone vendor, and is almost hanged as well after he admits his part. Fred and Barney reconcile, but before they can be hanged, Wilma and Betty arrive with the Dictabird. The workers release Fred and Barney after learning from the Dictabird that Cliff had fired them to frame Fred.
However, Cliff kidnaps Pebbles and Bamm-Bamm, leaving behind a ransom note demanding the Dictabird in exchange for the children's safe return. Fred and Barney encounter Cliff at the quarry, where Cliff has tied Pebbles and Bamm-Bamm to a huge machine. Though they hand him the Dictabird, Cliff activates the machine. Barney rescues the children while Fred destroys the machine. The Dictabird escapes from Cliff and lures him back to the quarry, where Miss Stone knocks him out, having had a change of heart after learning that Cliff planned to betray her. The police arrive with Wilma and Betty and Cliff attempts to flee, but a falling substance petrifies him.
With the Dictabird's help, all charges against Fred are dropped, while Miss Stone is arrested as Cliff's accomplice, though Fred is confident she will be granted leniency for helping them stop Cliff. Mr. Slate shows up, impressed with the substance that Fred inadvertently created by destroying the machine, dubs the substance "concrete" and makes plans to produce it with Fred as President of its division, thus ending the Stone Age, but Fred declines. Barney protests that this is a great position for Fred and not like the problems of before, but Fred explains to Mr. Slate that wealth and status changed him for the worse, and simply asks that all the workers be rehired and given the job benefits he originally set out to achieve, which is granted. As the Flintstones and Rubbles have finally made amends, Fred and Barney get into a humorous quarrel when Fred once again asks Barney for a small amount of money for breakfast. As they argue and leave, Mr. Slate remarks to himself "There goes the best executive I ever had."

Question: Why does Barney switch the exam?
Answer: Because he knows that Fred will fail