Friday, August 19, 2011

Program to recieve the address of variable using pointer through functions.

//Program to recieve the address of variable using  pointer through functions.
#include<stdio.h>
#include<conio.h>
main()
{
 int a,b;
 clrscr();
 printf(" enter the value of a and b:");
 scanf("%d%d",&a,&b);
 printf("\n values of a and b before swapping");
 printf("\n a=%d b=%d",a,b);
 void swap(int *x,int *y);
 swap(&a,&b);
 printf("\n values of a and b after swapping");
 printf("\n a=%d b=%d",a,b);
 getch();
}
void swap(int*x,int *y)
{
 int t;
 t=*x;
 *x=*y;
 *y=t;
}

Previous Next Home
0 Comments
Comments

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Twitter Delicious Facebook Favorites More