Computer Science, asked by avishkarwasade674, 4 days ago

2) Write a function in c++ to swapping.​

Answers

Answered by helpme000002
0
Mark me brainliest pls
First one is input
And below is output
Attachments:
Answered by dayanidhisharma19
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