UrbanPro
true

Take BCA Tuition from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Swapping Two Numbers

Pooja R.
17/04/2018 0 0

Q. Swap two numbers using the following function. Complete the function. You won't be allowed to use a temporary variable to swap the two numbers.

 

void swap ( ... )

{

  /* Swap code goes here */

}

 

int main ()

{

  int a[2] = {2,3};

  /* print the array so that a[0] is 3 and a[1] is 2 */

  /* swap function call and print code goes here */

}

0 Dislike
Follow 2

Please Enter a comment

Submit

Other Lessons for You

Do You Know Size Of Empty Class and Reason?
Size of empty class is always 1 byte. Reason is, in order to differentiate one object to another object, the size of empty class is always 1 byte. See the below c++ code snippet. Here there are three...

Definite book guides for C++
This post attempts to collect the few pearls among the dozens of bad C++ books. Unlike many other programming languages, which are often picked up on the go from tutorials found on the internet, only...

C++: Passing A Function As an Argument
#include using namespace std; int sum(int a,int b) { return a+b; } void f2(int (*f)(int,int),int a,int b) //'*f' is a POINTER TO A FUNCTION whose RETURN TYPE is ...

What Is The Difference Between Scope And Lifetime?
Scope of a variable is defined as the block of code from where we can refer or access it. On the other hand the life time of a variable is defined as the time in between allocating memory for it and relinquishing...

Understanding Big Omega (?), Big Theta (?), Small Oh (o) And Small Omega (?) Notations
How to describe Big Omega(Ω) ? If run time of an algorithm is of Ω(g(n)), it means that the running time of the algorithm (as n gets larger) is at least proportional to g(n). Hence it helps...
X

Looking for BCA Tuition Classes?

The best tutors for BCA Tuition Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Take BCA Tuition with the Best Tutors

The best Tutors for BCA Tuition Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more