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

Write a c program that accepts the year and weight , Based on the automobil...

Based on the automobile's model year and weight, the city of Cebu determines the car's weight class and registration fee using the following schedule: Model Year Registration

Implementation of the dictionary class, Implementation of the Dictionary cl...

Implementation of the Dictionary class: int Dictionary::find_word(char *s) {    char word[81];    for (int i = 0; i       if (stricmp(words[i].get_word(word),s) =

Tree, Write algorithm and program for the conversion of a Tree to a Binary ...

Write algorithm and program for the conversion of a Tree to a Binary Tree

Write the program of function templates, Consider the following example: ...

Consider the following example: int max(int x, int y)                  {                                 return ( x > y) ? x : y ;                  }   float max

Float number, We can combine more than one variable on the same line i.e. ...

We can combine more than one variable on the same line i.e.   float number1,number2,number3; etc Sometimes we want to mix the variable types used on the same line, this could

Database, write a c++ program to update employee records

write a c++ program to update employee records

#title.Thick line, #questio c++ program for drawing thick line

#questio c++ program for drawing thick line

Area under curve , c-program to find the area under the curve y=f(x) betwe...

c-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   #include float start_point, /

C program to print r diagonal triangle, C program to print R diagonal trian...

C program to print R diagonal triangle: #define rows 3 #define cols 3 void main() {                 int i=0,j=0;                 int arr[rows][cols];

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