Write a function to swap two numbers using pointer

Write a function to swap two numbers using pointer

swap two numbers


Enter the first number : 12
Enter the Second number : 22
First number : 22
Second number : 12

Explanation of basic commands of C language


This is a preprocessor command that includes standard input output header file(stdio.h) from the C library before compiling a C program.

int main()

This is the main function from where execution of any C program begins


This indicates the beginning of the main functions


whatever is given inside the command “/* */” in any C program, won’t be considered for compilation and execution.


printf commmand print the output on to the screen.


This command waits for any character intput from keyword

return 0;

This command terminates C program (main function) and returns 0.


This indicates the end of the main function.

Topics related to Program
  • Pointer in C language
  • Functions in C language
  • You may also like...

    Leave a Reply

    Your email address will not be published. Required fields are marked *