how to swap a number in c++ without third variable
Answers
Answered by
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
#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
CBSE BOARD X,
7 months ago
English,
7 months ago
Science,
7 months ago
Math,
1 year ago
Math,
1 year ago
Math,
1 year ago
Social Sciences,
1 year ago