Program of swapping in c++, C/C++ Programming

Program of swapping two varibales:

void swap(int *, int *);   // This is swap's prototype

int main()

{

                int x = 5, y = 7;

                swap(&x, &y);

                cout << "\n x is now "<< x << " and y is now " << y << '\n';

 

                return 0;

}

void swap(int *a, int *b)    // swap is actually defined here

{

                int temp;

                temp = *a;

                *a = *b;

                *b = temp;

}

Posted Date: 10/18/2012 9:25:02 AM | Location : United States







Related Discussions:- Program of swapping in c++, Assignment Help, Ask Question on Program of swapping in c++, Get Answer, Expert's Help, Program of swapping in c++ Discussions

Write discussion on Program of swapping in c++
Your posts are moderated
Related Questions
A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

write a program which has three classes

A cl a s s c a n b e d e f i n e d i n s i d e a b l o c k o r f u n c t i o n.   T h i s t yp e cla s s i s known

I want source code for class booking system by using C++ Programming...Urgent

Need an indicator Project Description: Need an indicator which indicates target and trailing sl after entering trades. Skills required are C Programming, C++ Programming,

Inheritance is the process of forming new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class,

Project Description: I will need a tutor that would help me out in Data Structure and learning Algorithm more at the mathematical/algorithmic level. The book is written by "by T

Normal 0 false false false EN-US X-NONE X-NONE

How do one throw polymorphically?               A: Sometimes people write code such as: class MyExceptionBase { }; class MyExceptionDerived : public MyExceptionBase { };

what will be the c program for ideal gas equation.