#include<conio.h>
#include<stdio.h>
void swap(int*a,int*b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;
}
void main()
{
int num1,num2;
clrscr();
printf("Enter Value For Number 1 : ");
scanf("%d",&num1);
printf("Enter Value For Number 2 : ");
scanf("%d",&num2);
printf("\nNum1 : %d\tNum2 : %d",num1,num2);
swap(&num1,&num2);
printf("\n\nSwaping....\n\n");
printf("\nNum1 : %d\tNum2 : %d",num1,num2);
getch();
}
#include<stdio.h>
void swap(int*a,int*b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;
}
void main()
{
int num1,num2;
clrscr();
printf("Enter Value For Number 1 : ");
scanf("%d",&num1);
printf("Enter Value For Number 2 : ");
scanf("%d",&num2);
printf("\nNum1 : %d\tNum2 : %d",num1,num2);
swap(&num1,&num2);
printf("\n\nSwaping....\n\n");
printf("\nNum1 : %d\tNum2 : %d",num1,num2);
getch();
}
0 comments:
Post a Comment