You are on page 1of 1

A program to swap two numbers in C language

using third variable

#include <stdio.h>

int main()

int x,y,z;

printf(“Enter two values: “);

scanf(“%d%d”,&x,&y);

z=x;

x=y;

y=z;

printf(“x=%d and y=%d”,x,y);

Visit Sikshapath.in to explore more answers

You might also like