Code In Tech - The Ultimate World of Computer Technology

Tuesday, 5 June 2012

Shell script for swapping two values

SOURCE CODE:

echo "Enter first value:"
read a
echo "Enter second value:"
read b
temp=$a
a=$b
b=$temp
echo "The swapped value is:"
echo "First value = $a"
echo "Second value = $b"



OUTPUT:

Enter first value:
25
Enter second value:
10
The swapped value is:
First value = 10
Second value =25

No comments :

Post a Comment