by Dinesh Thakur Category: C Programming (Pratical)

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

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.