Computer Science, asked by gayathri1111, 1 year ago

how to swap a number in c++ without third variable

Answers

Answered by Anonymous
1
C++ program to swap two numbers without using a temporary variable.

#include<iostream>

using namespace std;

/* Function for swapping the values */

void swap(int &a, int &b)

{

b = a + b;

a = b - a

please mark as BRAINliest answer


Anonymous: follow me and mark as BRAINliest answer
Similar questions