C program for swapping of two arrays.

source code


#include<stdio.h>
int main()
{
    int a,b;
    int *ptra,*ptrb;
    int *temp;
    printf("Enter any two integers: ");
    scanf("%d%d",&a,&b);
    printf("Before swapping: a = %d, b=%d",a,b);
    ptra = &a;
    ptrb = &b;
     temp = ptra;
    *ptra = *ptrb;
    *ptrb = *temp;
     printf("\nAfter swapping: a = %d, b=%d",a,b);
    getch();
    return 0;
}

Comments

Popular posts from this blog

8086 STRING MANIPULATION –FIND AND REPLACE A WORD

Animated Circles In C++

C program to find out the sum of series 1 + 2 + …. + n.