Skip to content

Tag Archives: Swap-Program

Given two arrays A and B of size N and an integer K, the task is to find the maximum possible sum of array A… Read More
Given two numbers x and y, we need to swap their values Examples: Input : x = 10, y = 20; Output : x =… Read More
Given two variables n1 and n2. The task is to swap the values of both the variables without using third variable.Examples:   X : 10 Y… Read More
Given two variables x and y, write a Python program to swap their values. Let’s see different methods in Python to do this task. Method… Read More
Given a string str, the task is to swap adjacent characters of this string in C. Examples: Input: str = "geeks" Output: NA Not possible… Read More
Given a String S of length N, two integers B and C, the task is to traverse characters starting from the beginning, swapping a character… Read More
Given two numbers, write a C program to swap the given numbers. Input : x = 10, y = 20; Output : x = 20,… Read More
  Given two variables, x, and y, swap two variables without using a third variable.   Method 1 (Using Arithmetic Operators)  The idea is to get… Read More