{ads}

6/recent/ticker-posts

write a Program to swap the two numbers by using third variable in c++

 




#include<iostream>
using namespace std;
int main()
{
int variable_one = 10;
int variable_two  = 20;
int variable_three;
// print values before swapping
cout<<"Variable_one :"<<variable_one<<endl;
cout<<"Variable_two :"<<variable_two<<endl;
//swap values using third variable
variable_three = variable_one;
variable_one = variable_two;
variable_two = variable_three;
//Print values after swapping
cout<<"Variable_one :"<<variable_one<<endl;
cout<<"Variable_two :"<<variable_two<<endl;
}

Post a Comment

1 Comments

  1. Thanks for sharing this amazing post this is the content i really looking for, it's very helpful i hope you will continue your blogging anyway if anyone looking for AutoCAD training institute in delhi contact us +91-9311002620 visit-https://www.htsindia.com/autocad-training-institute

    ReplyDelete