C++

Write a Program to implement Call By Value.

By April 5, 2016 November 9th, 2016 28 Comments

#include <iostream>
#include <conio.h>
using namespace std;
void swap(int, int);
main()
{
int a, b;
cout << “Enter two numbers: “;
cin >> a >> b;
cout << “\nBefore Swapping:\n”;
cout << “\na = ” << a << ” b = ” << b;
cout << “\n\nAfter Swapping:\n”;
swap(a, b);
getch()
}
void swap(int x, int y)
{
int t;
t = x;
x = y;
y = t;
cout << “a = ” << x << ” b = ” << y;
}

 

Output:

Enter two numbers: 2 4

Before swapping

a=2 b=4

After swapping

a=4 b=2

28 Comments

  • Youre so cool! I dont suppose Ive read anything like this before. So nice to search out someone with some unique ideas on this subject. realy thanks for starting this up. this web site is something that is wanted on the net, someone with a bit of originality. useful job for bringing one thing new to the internet!

  • It抯 onerous to search out knowledgeable people on this matter, however you sound like you know what you抮e talking about! Thanks

  • yeezy shoes says:

    My husband and i were really lucky that Jordan managed to carry out his reports while using the precious recommendations he obtained while using the blog. It is now and again perplexing just to always be making a gift of tricks which other folks have been making money from. And we also understand we need the website owner to be grateful to for that. The entire illustrations you’ve made, the simple website menu, the friendships you make it possible to engender – it’s got many spectacular, and it’s really letting our son in addition to our family consider that this matter is excellent, and that is quite mandatory. Thank you for all the pieces!

  • nmd r1 says:

    I was very pleased to search out this web-site.I needed to thanks to your time for this glorious read!! I positively enjoying each little bit of it and I’ve you bookmarked to take a look at new stuff you blog post.

  • I and my friends ended up checking the great guides from the blog then all of the sudden I had a horrible suspicion I had not thanked the site owner for those secrets. My guys ended up for that reason warmed to see all of them and already have actually been making the most of those things. Many thanks for turning out to be really thoughtful and for getting variety of incredible things most people are really needing to discover. Our own honest regret for not expressing appreciation to earlier.

  • An attention-grabbing discussion is worth comment. I believe that you must write more on this matter, it won’t be a taboo topic however generally individuals are not enough to speak on such topics. To the next. Cheers

  • The next time I learn a weblog, I hope that it doesnt disappoint me as a lot as this one. I imply, I do know it was my choice to learn, but I actually thought youd have something fascinating to say. All I hear is a bunch of whining about one thing that you would repair if you happen to werent too busy in search of attention.

  • Can I simply say what a aid to search out somebody who actually is aware of what theyre speaking about on the internet. You definitely know find out how to carry a difficulty to light and make it important. More people have to learn this and perceive this aspect of the story. I cant imagine youre no more widespread since you positively have the gift.

  • yeezy boost says:

    I and also my buddies have already been reading through the excellent tricks on the website and so quickly came up with an awful feeling I never expressed respect to the web site owner for them. All the young men ended up certainly passionate to read them and have in effect definitely been having fun with those things. I appreciate you for simply being simply accommodating and also for getting some awesome ideas most people are really needing to discover. My sincere apologies for not expressing gratitude to sooner.

  • WONDERFUL Post.thanks for share..extra wait .. ?

  • hermes belt says:

    Good post. I study one thing more challenging on different blogs everyday. It will always be stimulating to read content from other writers and follow a little one thing from their store. I抎 want to make use of some with the content material on my weblog whether or not you don抰 mind. Natually I抣l provide you with a link on your web blog. Thanks for sharing.

  • I really wanted to jot down a comment so as to appreciate you for those fabulous tactics you are giving out at this website. My extensive internet investigation has finally been rewarded with really good facts and techniques to talk about with my company. I would mention that many of us site visitors are very lucky to be in a fantastic place with very many outstanding professionals with useful techniques. I feel very much privileged to have discovered the webpage and look forward to plenty of more enjoyable moments reading here. Thank you once more for all the details.

  • Aw, this was a very nice post. In thought I would like to put in writing like this moreover ?taking time and actual effort to make an excellent article?but what can I say?I procrastinate alot and certainly not appear to get something done.

  • adidas neo says:

    Youre so cool! I dont suppose Ive read anything like this before. So nice to seek out any person with some unique thoughts on this subject. realy thanks for starting this up. this website is one thing that’s needed on the net, somebody with just a little originality. helpful job for bringing something new to the web!

  • I found your blog website on google and check a few of your early posts. Proceed to keep up the very good operate. I simply additional up your RSS feed to my MSN Information Reader. Searching for forward to reading more from you later on!?

  • I was very happy to seek out this internet-site.I wanted to thanks to your time for this excellent learn!! I undoubtedly having fun with every little bit of it and I’ve you bookmarked to check out new stuff you blog post.

  • Aw, this was a very nice post. In thought I wish to put in writing like this moreover ?taking time and precise effort to make an excellent article?but what can I say?I procrastinate alot and certainly not seem to get one thing done.

  • kobe 9 says:

    You made some first rate factors there. I seemed on the web for the issue and located most people will associate with along with your website.

  • It is best to participate in a contest for among the finest blogs on the web. I’ll advocate this web site!

  • yeezy shoes says:

    I am also writing to let you understand what a incredible discovery our child experienced using your site. She even learned a lot of details, not to mention what it is like to possess an excellent teaching heart to get the rest very easily gain knowledge of certain extremely tough matters. You undoubtedly did more than readers’ expectations. I appreciate you for supplying such good, dependable, explanatory and as well as unique guidance on this topic to Jane.

  • After I initially commented I clicked the -Notify me when new comments are added- checkbox and now every time a remark is added I get 4 emails with the identical comment. Is there any way you’ll be able to remove me from that service? Thanks!

  • Good post. I learn something tougher on completely different blogs everyday. It’s going to always be stimulating to read content from different writers and follow a bit something from their store. I抎 choose to use some with the content material on my blog whether or not you don抰 mind. Natually I抣l offer you a link on your web blog. Thanks for sharing.

  • adidas neo says:

    I am usually to running a blog and i really respect your content. The article has really peaks my interest. I am going to bookmark your site and preserve checking for new information.

  • A formidable share, I simply given this onto a colleague who was doing a little bit evaluation on this. And he in fact bought me breakfast because I discovered it for him.. smile. So let me reword that: Thnx for the deal with! However yeah Thnkx for spending the time to debate this, I really feel strongly about it and love reading extra on this topic. If potential, as you become experience, would you thoughts updating your blog with extra particulars? It’s highly useful for me. Large thumb up for this weblog publish!

  • The following time I learn a weblog, I hope that it doesnt disappoint me as much as this one. I imply, I know it was my option to learn, however I really thought youd have something fascinating to say. All I hear is a bunch of whining about something that you could fix should you werent too busy in search of attention.

  • yeezy shoes says:

    Thank you so much for giving everyone such a memorable opportunity to discover important secrets from this website. It really is very excellent and as well , stuffed with fun for me and my office acquaintances to search the blog particularly 3 times in a week to find out the newest tips you have. Of course, I’m actually fascinated considering the powerful creative ideas you give. Some 2 points on this page are surely the very best I’ve ever had.

  • You made some first rate points there. I looked on the web for the issue and located most individuals will go along with together with your website.

  • Oh my goodness! a tremendous article dude. Thanks Nonetheless I’m experiencing problem with ur rss . Don抰 know why Unable to subscribe to it. Is there anybody getting identical rss problem? Anybody who is aware of kindly respond. Thnkx

Leave a Reply