by Dinesh Thakur

In this program user ask to swap the numbers. User declares the variables for containing the value in it. User define the method with arguments or parameter (*int, int*). Then user assign the value to each variables then print the message to before and after value phase in each variable. Next move to call the function that declares the early in the program. Using swapping method as usual. Display the result on the screen as output.

Problem Statement

This is C program that asks user to swap two numbers.

  1. Declare the variables.
  2. Using method.
  3. Display the result on the screen.

Here is C source code to swap the two numbers. The output of this program shown below. 

int swaping(int *,int *);
    int a,b;
    printf ( "Before swaping a = %d & b = %d",a,b);
    printf("\nAfter swaping a = %d & b = %d",a,b);
  int swaping(int * a, int * b)
 C Program Swap Two Number