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

Programming Exercises

Create a program to swap two variables without using a third variable.

Easy

Problem Statement

Create a program to swap two variables without using a third variable.

Sample Input

Numbers: 4 and 7

Sample Output

After Swap: a = 7, b = 4

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
using System; class SwapVariables { static void Main() { // Declare two variables and swap them } }
Log in or sign up to run or submit your code.Log inSign up
Input
Numbers: 4 and 7
Expected Output
After Swap: a = 7, b = 4