Monday 27 August 2012

c program | How to write code for swap two number using pointer

C program | swap two number using pointer using  code | function swap
#include<stdio.h>
void swap(int*,int*);
void main()
{
int a,b;
clrscr();
printf("\nEnter 2 Numbers:");
scanf("%d%d",&a,&b);
printf("\nValues After Swaping.");
swap(&a,&b);
printf("\n a=%d  b=%d",a,b);
}
void swap(int*x,int*y)
{
int temp;
temp=*x;
*x=*y;
*y=temp;
}
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: