C program to swap the two values, C/C++ Programming

Program is to swap the two values which are enter by user:

Program is to swap the two values which are enter by user through the function with values changed using pointers

void swap(int *p,int *q);

void main()

 {

 clrscr();

 int a,b;

 cout<<" enter the number ";

 cin>>a;

 cout<<" enter the number ";

 cin>>b;

 swap(&a,&b);

 cout<<" the numbers after the value being changed "<<"\n"<

 }

 

void swap(int *p,int *q)

 {

  int r;

   r=*p;

  *p=*q;

  *q=r;

 }

Posted Date: 10/19/2012 7:59:31 AM | Location : United States







Related Discussions:- C program to swap the two values, Assignment Help, Ask Question on C program to swap the two values, Get Answer, Expert's Help, C program to swap the two values Discussions

Write discussion on C program to swap the two values
Your posts are moderated
Related Questions
C program to show overloading of matrix operator: Write a program for matrix operator overloading. class matrix{                   private :                 int x[

steric in square

create a program to populate the first array then the odd number is the second array and get the sum of the second array.

Write a function that takes in a radius and evenly covers the screen with circles of that radius. Don't attempt to draw any circles that are completely off the screen.

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with '

Write a program to create a binary file and store the following data "hello", 0x0030,'1', 1.234  Using visual studio examine the binary file and note how the day is stored   Answe

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

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 that counts the number of occurances of the string in the n-th padovan string p(n)

The Special Pointer 'this' When various instances of a class come into existence, it naturally follows that each instance has its own copy of member variables. If this were not