C++ program to swap two characters and integers by call by value

 

Sample Input
Enter 1st character:A
Enter 2nd character:B
Enter 1st integer:1
Enter 2nd integer:2
Sample Output
Before swapping
Value of 1st character:A
Value of 2nd character:B
Value of 1st integer:1
Value of 2nd integer:2
In function after swapping
Value of 1st integer:2
Value of 2nd integer:1
In function after swapping
Value of 1st character:B
Value of 2nd character:A
Outside function after swapping
Value of 1st character:A
Value of 2nd character:B
Value of 1st integer:1
Value of 2nd integer:2

You may also like...