Swapping using Pointer in C Programming Tamil


/*swap the numbers using pointer*/
#include<stdio.h>
#include<conio.h>
void exc(int *,int *);
void main()
{
    int a,b;
    clrscr();
    printf("\nEnter two numbers :");
    scanf("%d%d",&a,&b);
    printf("\nBefore Exchanging : %d\t%d\n",a,b);
    exc(&a,&b);
    printf("\nAfter Exchanging :%d\t%d\n",a,b);
    getch();
}
void exc(int *m,int *n)
{
   int t;
   t=*m;
   *m=*n;
   *n=t;
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming