Write a program to swap two values so that what is in Value1 would be interchanged with what is in value 2
Preitykelz
0
Newbie Poster
Recommended Answers
Jump to Post#include <iostream> using namespace std; void swapNumbers(int &x, int &y) { int tmp= x; x=y; y=tmp; } int main() { int a,b; cin >> a; cin >> b; cout<< "Numbers are " <<a <<" "<< b <<endl; swapNumbers(a,b); cout << "Swaped numbers are " << a <<" …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.