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


Need help finishing my homework. It''s been 5 years since I''ve use C++. I am a VN.Net programmer. -Todd

C program to demonstrate Pointer to variable: void p2a(int *); void main() {                 int x=10, *a,**b;                 int arr[5];                 //poin

What are the debugging methods you employ while came across a problem? A: Debugging with tools such as: 1.      DBG, GDB ,Forte, Visual Studio. 2.      Using tusc to trace

The zipped folder int_collection.zip (downloaded from Blackboard) contains an abstract class AbstractIntCollection and two interfaces: IntList and IntStack. The abstract class cont

Explain the class invariant. - It's a condition that ensures correct working of a class and defines all the valid states for an object. - When an object is created class inv

I need vsti program Project Description: Knowledge of vsti programs, and music is a plus, ex: nexus I will input the sounds I just need the interface built Skills required


Develop a client and a server for an instant messaging system based on UDP and IPv4