clanguage07@gmail.com

clanguage07@gmail.com

Saturday, June 16, 2012

swaping c program

#include<stdio.h>
#include<conio.h>
void swap(int*, int*);
void main()
{
    int a,b;
    clrscr();
    printf("\n\t Enter a=");
    scanf("%d",&a);
    printf("\n\t Enter b=");
    scanf("%d",&b);
    printf("\n\t before calling the function");
    printf("\n\t a=%d b=%d",a,b);
    swap(&a ,&b);
    printf("\n\t after calling the function");
    printf("\n\t a=%d b=%d",a,b);
    getch();
}
void swap(int*x, int*y)
{
    int temp;
    temp=*x;
    *x=*y;
    *y=temp;
    return;
}

No comments:

Post a Comment

GET MORE INFORMATION

http://ads.qadservice.com/t?id=c2168e05-8974-4816-872a-91936ff7379d&size=1024x768&drct=true