Saturday, February 19, 2011
Swapping two variables without using third variable in java
Java code to swap two numbers without using temporary variable
import java.io.*;
class Test {
public static void main(String[] args) throws IOException {
int a,b;
System.out.println("Enter first number:");
BufferedReader br1=new BufferedReader(new InputStreamReader (System.in));
a=Integer.parseInt(br1.readLine());
Labels:
Java
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment