/* 5 program of swap 2 number */
#include<stdio.h>
#include<conio.h>
void swap(int *,int *);
void exchange(int **, int *);
void main()
{
int c,d;
clrscr();
printf("Enter the value of c and d:\n");
scanf("%d %d",&c,&d);
swap(&c,&d);
printf("value of c=%d \nvalue of d=%d",c,d);
getch();
}
void swap(int *cc, int *dd)
{
exchange(&cc,dd);
}
void exchange(int **cc, int *dd)
{
int t;
t=**cc;
**cc=*dd;
*dd=t;
}
#include<stdio.h>
#include<conio.h>
void swap(int *,int *);
void exchange(int **, int *);
void main()
{
int c,d;
clrscr();
printf("Enter the value of c and d:\n");
scanf("%d %d",&c,&d);
swap(&c,&d);
printf("value of c=%d \nvalue of d=%d",c,d);
getch();
}
void swap(int *cc, int *dd)
{
exchange(&cc,dd);
}
void exchange(int **cc, int *dd)
{
int t;
t=**cc;
**cc=*dd;
*dd=t;
}
No comments:
Post a Comment