Java

Wednesday, 8 April 2015

C program to apply Swapping Technique

Program:


 Read: Java program to apply graphical methods using Applets

#include<stdio.h>
#include<conio.h>
swap(int , int);
void main()
{
int a,b;

clrscr();
printf("enter a,b values");
scanf("%d\n%d",&a,&b);
printf("a=%d\tb=%d\n",a,b);
swap(a,b);
getch();
}
swap(int x,int y){
int t;
t=x;
x=y;
y=t;
printf("a=%d\tb=%d",x,y);
}

No comments:

Post a Comment