Skip to content · ⁨Saltar al contenido⁩

Swap two values · ⁨Intercambiar dos valores⁩

English

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.

Español

Intercambiar dos valores

swap recibe punteros a dos enteros y debe intercambiar sus valores. A través de un puntero, *a lee — o escribe — el valor al que apunta. Utilice una variable temporal para no perder un valor mientras copia el otro.

Log in or create account · ⁨Iniciar sesión o crear cuenta⁩

IGCSE, A-Level & AP