I have an existing 220v 50 amp plug in my garage just bought a new 40 amp Range, would like to plug in range in garage just till after thanksgiving Then will replace aa cooktop with it in kitchen can I buy a cord to match the 50 amp plug and use range over thanksgiving or will it ruin range or be a safety hazard
Using a 50A plug and receptacle is allowed on a 40A circuit because of an exception in the Electrical Code. The exception is because 40A receptacles do not exist, or rather, are not part of the NEMA standards. (There are enough varieties of receptacle already!)
The circuit breaker must be no larger than the wiring is fit for - if the wiring is 8 AWG, the breaker must be 40A (or smaller). If the wire is 6 AWG, the breaker may be 40 or 50 amps (or any value up to 50A). With large circuits like this, there is only one appliance per circuit. I am not sure whether it is legal to plug a 40A rated appliance into a circuit breakered for 50A. I would downgrade the breaker to 40A for an extra bit of safety.
This is a good time to look at the receptacle. If it's an old NEMA 10-50 type, it does not have a ground wire, and any problem with the neutral can electrify the chassis of the stove, a potentially lethal situation. A ground wire can be retrofitted using any viable route back to the panel. (Grounds don't have to travel with the conductors). Then you can upgrade the connectors to NEMA 14-50 type and change the jumper on the appliance to use a separate ground.
First -- there is no NEMA 10-40 or 14-40 plug or receptacle, only the 10-50 and the 14-50. (We already have a zillion flavors of receptacle, so why add more?) So, the Code says to use 50A receptacles on 40A branch circuits to begin with -- this is in 210.21(B) and its associated table. (Other places in the Code also use the verbiage "the receptacle rating shall be no less than the branch circuit rating".)
Second, the breaker protects the wiring of the branch circuit -- plugging a 40A range into a 50A circuit is simply a bigger form of plugging a 1A radio into a 15A circuit, something we do all the time. Furthermore, it is sanctioned by NEC 210.22:
210.22 Permissible Loads, Individual Branch Circuits. An individual branch circuit shall be permitted to supply any load for which it is rated, but in no case shall the load exceed the branch-circuit ampere rating.
Finally, do check the wiring -- 8AWG wiring goes with a 40A breaker, and 6AWG wiring with a 50A. Furthermore, the old-style NEMA 10-50s lack a ground, instead using the neutral as ground. This should be rectified, lest an open neutral cause the stove's chassis to go hot. Fortunately, the NEC allows branch circuit ground wires to be retrofitted whichever way is most convenient instead of forcing them to run with the circuit wires, so running a 6AWG wire or bare armored ground cable via the most practical route back to the panel is the easiest way to do it. Then you can put a 14-50 in and re-jumper the appliance for a separate ground.