C Program to swap two numbers with using third variable. / सी तीसरे चर का उपयोग करने के साथ दो नंबर स्वैप करने के लिए कार्यक्रम।












C Program to swap two numbers with using third variable




C Program to swap two numbers with using third variable



#include <stdio.h> int main() { int x,y,z; printf("\n Enter x value :"); scanf("%d",&x); printf("\n Enter y value :"); scanf("%d",&y); printf("\n Before swapping x value: %d",x); printf("\n Before swapping y value: %d",y); z=x; x=y; y=z; printf("\n After swapping x value: %d",x); printf("\n After swapping y value: %d",y); return 0; }


Output:
Enter x value :200 Enter y value :300 Before swapping x value: 200 Before swapping y value: 300 After swapping x value: 300 After swapping y value: 200