Skip to content · ⁨Перейти к содержанию⁩

Swap two values · ⁨Поменять местами два значения⁩

Swap two values

swap receives pointers to two integers and must exchange their values. Through a pointer, *a reads — or writes — the value it points at. Use a temporary variable so you don't lose one value while copying the other.

Log in or create account · ⁨Войти или создать аккаунт⁩

IGCSE, A-Level & AP