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

Assignment Help:

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;

 }


Related Discussions:- C program to swap the two values

#title prime number or not, to find prime numbers upto any number say "n" e...

to find prime numbers upto any number say "n" entered by user

Explain bit-wise operators, Bit-wise Operators Some applications requir...

Bit-wise Operators Some applications require operations to be done on dissimilar bits of a byte separately. Bit-wise operators offer a facility to do just that. There are vario

Text Editor, Add a function for saving the text stored in an array to a fil...

Add a function for saving the text stored in an array to a file. Your program must check whether or not the output file already exists, and if it does, your program must ask the us

Flow chart, flow chart for calculating the volume of sphere

flow chart for calculating the volume of sphere

Nested if else, input marks of c and c++ if c grater than equal to 50 grate...

input marks of c and c++ if c grater than equal to 50 grater than 50 you are pass if c greater than equal to 50 c++ less than 50 than supplementry c++ if c less then 50 and c++ gra

Compiler designin liliting instruction, Ravi is a newbie to the programming...

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules:

String program, Write a C++ program which does the following: 1. Asks th...

Write a C++ program which does the following: 1. Asks the user to enter the following text "Four score and seven years ago there was a man named Joey Bagadonuts." 2. Save thi

Converting base type to class type (char to string), Converting Base Type t...

Converting Base Type to Class Type (char to string)   class String { char *name; int length; public: String(void) {length =0; name = new char[length+1];

Client server using c, (a) client server or multithreaded client-server, wh...

(a) client server or multithreaded client-server, where server will create pool of worker threads (say 5) to provide services to pool of clients (say 5 ).Server should be behaving

Equation, My project is compiling but the equation entered is not working

My project is compiling but the equation entered is not working

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd