Write a C++ program to swap two numbers using: (Call -by-value and Call by-reference)

Опубликовано: 01 Январь 1970
на канале: way2tech knowledge
312
like

Write a C++ program to swap two numbers using: 1)Call -by-value 2) Call -by-reference #cprogramming

Description:
Call -by-value
During execution, the program should print the following message on the console
as:
Enter two integer values :
For example, if the user gives the following input as:
Enter two integer values : 22 44
Then the program should print the result as follows:
Before swapping in main : a = 22 b = 44
After swapping in swap : x = 44 y = 22
After swapping in main : a = 22 b = 44
Call -by-reference
At the time of execution, the program should print the message on the console as:
Enter two integer values :
For example, if the user gives the input as:
Enter two integer values : 12 13
then the program should print the result as:
Before swapping in main : a = 12 b = 13
After swapping in swap : *p = 13 *q = 12
After swapping in main : a = 13 b = 12

Are you curious to learn more about Object Oriented Programming in C++ and why we use it? This video has the answers you need! We’ll discuss what OOP is, why it’s beneficial to use C++ for OOP, and types of comments. Learn the basics of OOP today, so you can get started with this great language.
_______________________________________________________________________
Make sure you have basic knowledge of HTML before watching my another videos.
   • Internal CSS with Example in Hindi (P...  
comment in CSS with example
   • Comment in CSS in Hindi(Part-11) for ...  
👍👌

Create Gmail Account in Hindi
   • Gmail Account  
________________________________________________
Install Text Editors in Hindi
   • Install TextEditors (Hindi)  
_________________________________________________
CSS and CSS3 in Hindi
   • Css and Css3 (Hindi)  
_________________________________________________
HTML and HTML5 In Hindi
   • Basic HTML Program  
____________________________________________________
You can find out HTML Complete Video Tutorials :
   • what is HTML in Hindi || HTML Extensi...  
CSS Complete Video Tutorials playlist :
   • Introduction to CSS and CSS3(Hindi)  ...  

check out our Other Playlists:
   • hello  world  program using HTML in H...  
___________________________________________________________________________
I'm on Instagram as @way2tech_knowledge
https://www.instagram.com/invites/con...

Please like 👍, comment 🙏, and SUBSCRIBE 🙏🤗 and don't miss the press Ball icon button...🤗

#short #shortvideo
#Youtube #way2tech_knowledge #UploadYoutubeVideo #howtousecss
#YoutubeVideoUpload #firstshortvideo #youtubeshort #viral

if you have any query please comment the comment box ..I will definitely reply.🙏💯

Thanks for watching 🙏💯
___________________________________________________________________

Keywords:
What is structure explain with example?
What is C++ explain structure of C++ program with example?
What is structure type in C++?
What are 5 examples of structures?
What is structure with an example in C language?
What are the 4 types of structures?
How do you print a multiplication table from a given number?
What is the C++ program function to swap two numbers?
How do you write a program to swap two numbers?
How to swap two digits in a number in C?
What is call by value in C++?
What is the syntax of swap in C++?
What is the difference between call by value and call by reference?
How to swap two numbers in C using call by reference?
Is swap a function in C++?
What is an example of a swap?

________________________________________________________________________

if you have any query to send me mail by...
[email protected]
_______________________________________________________________________