Switch assignments for variables x and y, for example

start with x = 1 and y = 3 end with y = 1 and x = 3

Do NOT simply re-assign variables, use a temporary variable 'z'

Solution Stats

815 Solutions

511 Solvers

Last Solution submitted on Aug 13, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers511

Suggested Problems

More from this Author28

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!