Swapping in C++

#include"stdafx.h"
#include<iostream>
usingnamespace std;
void main ()
{
int C,D,A;
cout<<"Enter the value of C"<<endl;
cin>>C;
cout<<"Enter the value of D"<<endl;
cin>>D;
A=C;
C=D;
D=A;
cout<<"After interchanging the value of C is \n";
cout<<C<<endl;
cout<<"After interchanging the value of D is \n";
cout<<D<<endl;
system("pause");

No comments:

Post a Comment