Ad Code

Write a program to swap two number using function.

 Write a program to swap two number using function.

 


#include<stdio.h>
#include<conio.h>
void int(int*,int*);
void main();
{
int a=10,b=20;
clrscr();
printf(“values before swapping”);
scanf(“%d%d”,a,b);
swap(&a,&b);
printf(“values after swapping”);
scanf(“%d%d”,a,b);
getch();
}
void swap(int*x,int*y)
{
int temp;
temp=*x;
*x=*y;
*y=temp;
}

Post a Comment

0 Comments

Ad Code