cstartes
Search stops here
Pages
Home
Blogroll
Guest Post
Privacy Policy
Contact Us
About
Program to swap the value of two integer using pointer.
void main()
{
int a,b;
int *pa,*pb,*temp;
clrscr();
printf("Enter the 2 values");
scanf("%d",&a,&b);
printf("Before swapping :a=%d b=%d",a,b);
pa=&a;
pb=&b;
temp=pa;
pa=pb;
pb=temp;
printf("After swapping:a=%d b=%d",&8pa,8pb);
pb=temp;
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment