Header Ads Widget

Responsive Advertisement

Ticker

6/recent/ticker-posts

Write a c program to swap two numbers ?

 Write a c program to swap two numbers?  
 #include <stdio.h>   
 #include <conio.h>  
 int main()  
 {  
   int a, b, temp;  
   printf("Enter the value of x and y\n");  
   scanf("%d%d", &a, &b);  
   printf("Before Swapping\nx = %d\ny = %d\n",a,b);  
   temp = a;  
   a  = b;  
   b  = temp;  
   printf("After Swapping\nx = %d\ny = %d\n",a,b);  
   return 0;  
 } 

 

Post a Comment

0 Comments