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;
}
0 Comments
Have any query? Want any type of module?
Please comment it down and let me know.