2) Write a function in c++ to swapping.
Answers
Answered by
0
Mark me brainliest pls
First one is input
And below is output
First one is input
And below is output
Attachments:
Answered by
0
Answer:
#include<iostream>
using namespace std;
void swap(int ,int );
int main()
{
int x,y;
cout<<"Enter values of x and y respectively : ";
cin>>x>>y;
swap(x,y);
}
void swap(int x,int y)
{
int temp=x;
x=y;
y=temp;
cout<<"Swapped values are\n";
cout<<"x : "<<x<<" y : "<<y;
}
Similar questions