#include<stdio.h>
void anik(int *a, int *b, int *c)
{
int rob;
rob = *a;
*a = *b;
*b = *c;
*c = rob;
}
int main()
{
int x, y, z;
printf("Enter x : ");
scanf("%d", &x);
printf("Enter y : ");
scanf("%d", &y);
printf("Enter z : ");
scanf("%d", &z);
anik(&x, &y, &z);
printf("\nAfter Swapping : \n");
printf("x = %d\n", x);
printf("y = %d\n", y);
printf("z = %d\n", z);
return 0;
}
void anik(int *a, int *b, int *c)
{
int rob;
rob = *a;
*a = *b;
*b = *c;
*c = rob;
}
int main()
{
int x, y, z;
printf("Enter x : ");
scanf("%d", &x);
printf("Enter y : ");
scanf("%d", &y);
printf("Enter z : ");
scanf("%d", &z);
anik(&x, &y, &z);
printf("\nAfter Swapping : \n");
printf("x = %d\n", x);
printf("y = %d\n", y);
printf("z = %d\n", z);
return 0;
}
Comments
Post a Comment