/* program to swap of two variable */
# include < stdio.h >
void main ()
{
int a,b ;
clrscr () ;
printf ("\n enter the value of a:") ;
scanf ("%d",& a) ;
printf ("\n enter the value of b:") ;
scanf ("%d",& b) ;
c = a ;
a = b ;
b = c ;
printf ("\n swap =%d", a) ;
printf ("\n swap =%d", b) ;
getch () ;
}
# include < stdio.h >
void main ()
{
int a,b ;
clrscr () ;
printf ("\n enter the value of a:") ;
scanf ("%d",& a) ;
printf ("\n enter the value of b:") ;
scanf ("%d",& b) ;
c = a ;
a = b ;
b = c ;
printf ("\n swap =%d", a) ;
printf ("\n swap =%d", b) ;
getch () ;
}
No comments:
Post a Comment