Computer Science, asked by tejaswi1653, 3 months ago

#include miostream.h>
#include<conio.h>
You
void main()
1
clrscro;
int a, b, temp;
cout<<"Enter two numbers:";
cin>>a>>b;
tempa;
a=b;
b=temp;
coul<<"After swapping the values are a="<<a<<".
and b="<<b;
getch();​

Answers

Answered by Sanuli
1

Answer:

ENTER TWO NUMBERS: 12 14

AFTER SWAPPING THE VALUES ARE A= 14 AND B= 12.

Explanation:

WE ASSIGN VALUE OF A TO TEMP(TEMPORARY VARIABLE)

THEN WE ASSIGN VAL OF TEMP TO B

AND AT LAST WE ASSIGN VALUE OF TEMP BACK TO A

Similar questions