Bsit Special | Bsit past papers for all semester | Books for bsit | Notes For bsit for all semester| C++ Questions and Answer| Cpp/C++ full course in urdu/hindi | Java| Python| Html | Online C++ Mcqs| Programs in c++ |BSCS BSSE BSIT Past Papers | bs programs past papers And notes for all semester |Online c++ quiz Answer And questions|

Set1 » Solution Number 7


How to swap variable/values in c++ program

Codeing:

#include<iostream>
using namespace std;

int main()
{
 int a,b,temp;
 cout<<"\nEnter two numbers : ";
 cin>>a>>b;
 temp=a; 
 a=b;
 b=temp;
 cout<<"\nAfter swapping numbers are : ";
 cout<<a<<" "<<b;

 
 return 0;
}


< Back
 Back 

Post a Comment

[blogger]

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget