Java program to swap two numbers
class Swap{ public static void main(String...s) { int a,b,temp; a=Integer.parseInt(s[0]); b=Integer.parseInt(s[1]); System.out.println("
Before Swap:
"+"a="+a+" b="+b); temp=a; a=b; b=temp;
System.out.println("
After Swap:
"+"a="+a+" b="+b); }}
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.