How to swap two String values without using a
third variable?
Answer Posted / bharat
import java.util.Scanner;
public class Swap {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int a, b;
System.out.println("Enter a and b");
Scanner in = new Scanner(System.in);
a = in.nextInt();
b = in.nextInt();
System.out.println("Befor Swapinng :" + "a : " + a + "\t" + "b :" + b);
b = a + b;
a = b - a;
b = b - a;
System.out.println("a : " + a + "\t" + "b :" + b);
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Colors specified with the notation
What for decision coverage and modified condition decision coverage are used? Wat is the difference between them?
hi This is radhika.Can anyone help me to know the question papers of NATIONAL INFORMATICS CENTRE for the post of scientific officer/engineer? if anyone know plz tell me question paper pattern
You are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called?
how to add a new table with variables and thier values into a imported file uisng proc import?
Given an array of size n+1 which contains all the numbers from 1 to n.Find the number which is repeated in O(n) time.How do you proceed with the same with floating numbers from 0 to 1 instead of 1 to n?
Hi..Am done with my Masters recently..Am planning to learn TIBCO.. could anyone suggest me about how the job market will be and Is there any course necessary to learn prior to Tibco..i mean any prerequisite. I dnt have any knowledge on PL/SQL thats it... Plz suggest me in a best way...
what are all the ant command options
give idea for creating screen in abap
why not instantiating servet using new operator?
Display names and numbers of employees who have 5 years or more experience and salary less than Rs.15000 using array of structures (name, number, experience and salary)
Define Form modules, Class modules and Standard modules
1. How many jobs can we write in a single file? 2. How many maximum members can exist in a single partition data set(pds) in jcl?
What is the Difference between in memory database and physical database
How to get the index of the clicked field in reports in ABAP?