C Programming
Computer Programming

Program in c to Swap two numbers



Write a Program in c to Swap two numbers

\* C Program to to Swap two numbers *\

# include < stdio.h >
int   main( )
{

int   a,b,temp ;
printf(" Enter the first Number : ") ;
scanf("%d ", & a) ;
printf(" \n Enter the second Number : ") ;
scanf("%d ", & b) ;
printf("\n Number Before swaping : ") ;
printf("\n %d \t %d ",  a,   b ) ;
temp = a  ;
a = b  ;
b = temp  ;
printf("\n Number After swaping : ") ;
printf("\n %d \t %d ",  a,   b ) ;
return ( 0 ) ;

}

Output of Program :

Output of Program in C to Swap two numbers