Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a PHP script to swap two variables $x = 5 and $y = 10 without using a third variable.

Easy

Problem Statement

Create a PHP script to swap two variables $x = 5 and $y = 10 without using a third variable.

Sample Input

Two variables $x = 5 and $y = 10.

Sample Output

x = 10, y = 5

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
<?php // Write code to here ?>
Log in or sign up to run or submit your code.Log inSign up
Input
Two variables $x = 5 and $y = 10.
Expected Output
x = 10, y = 5