google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to interchange the values of two variables using a third variable - 2nd puc computer science

Write a program to interchange the values of two variables using a third variable

//Write a C++ program to interchange the values of two variables using third variable.

 #include<iostream.h>

#include<conio.h> void main( ) { int a, b, temp; clrscr( ); cout<<"Enter the two numbers:\n"; cin>>a>>b; cout<<"Before Interchanging : a ="<<a<<" and b = "<<b<<endl; temp = a ; a = b ; b = temp ; cout<<"After Interchanging : a ="<<a<<" and b = "<<b<<endl; getch(); }

Write a program to interchange the values of two variables using a third variable Write a program to interchange the values of two variables using a third variable Reviewed by Vision Academy on February 20, 2022 Rating: 5

No comments:

CheckOut

Powered by Blogger.