quote:
Originally posted by Ezra
Now i dont want you to tell me how to do this, just tell me if its possible and a tip maybe o.O
He wants the swapping function
The answer is as follows
code:
#include <stdio.h>
#include <conio.h>
void main()
{
float a,b;
clrscr();
printf("Enter values of a and b: ");
scanf("%f %f",&a,&b);
printf("\n\nBefore swapping\n");
printf("a = %f \nb = %f",a,b);
swap(&a,&b);
printf("\n\nAfter swapping\n");
printf("a = %f \nb = %f",a,b);
getch();
}
void swap(float *x, float *y)
{
float temp = x;
x = y;
y = x;
}