Write a C++ program that will ask user to enter two integral numbers. The numbers should be swapped without using any third variable.

C++ program that will ask user to enter two integral numbers. The numbers should be swapped without using any third variable.

Object:

Write a C++ program that will ask user to enter two integral numbers. The numbers should be swapped without using any third variable. Your code should be able to do the same process for 30 cycles. It should also show the swapped numbers at the each cycle. C++ Projects.

Code:

#include<iostream>
#include<conio.h>

using namespace std;
void main()
{
int a,b;
for(int i=1; i<=30; i++)
{
cout<<“\nCycle:”<<i<<endl;
cout<<“Enter a Value a : “;
cin>>a;
cout<<“Enter a Value b : “;
cin>>b;
a=a+b;
b=a-b;
a=a-b;
cout<<“\nAfter Swapping These Two Numbers.\n”;
cout<<“Vale of a is: “<<a<<endl;
cout<<“Vale of b is: “<<b<<endl;
}
getch();
}

```#include<iostream>
#include<conio.h>

using namespace std;
void main()
{
int a,b;
for(int i=1; i<=30; i++)
{
cout<<"\nCycle:"<<i<<endl;
cout<<"Enter a Value a : ";
cin>>a;
cout<<"Enter a Value b : ";
cin>>b;
a=a+b;
b=a-b;
a=a-b;
cout<<"\nAfter Swapping These Two Numbers.\n";
cout<<"Vale of a is: "<<a<<endl;
cout<<"Vale of b is: "<<b<<endl;
}
getch();
}
```

Output:

Another Program: Write a C++ program which takes the price of bakery items ranging from 0-999