Anonymous Quiz
2%
Functional
93%
Object Oriented
2%
Markup
3%
Structured
👍1😁1
/* Question - 15
🚨 Interview Important Question 🚨
Java Program Swapping Of Two Numbers Without Using Third Variable
*/
package ABC;
import java.util.*;
public class Main {
public static void main(String[] args) {
int Num1,Num2;
Scanner S = new Scanner(System.in);
System.out.println("Enter Value Num1:");
Num1 = S.nextInt();
System.out.println("Enter Value Num2:");
Num2 = S.nextInt();
// Condition
Num1 = Num1 + Num2;
Num2 = Num1 - Num2;
Num1 = Num1 - Num2;
// After Swapping
System.out.printf("Value Of Num1,Num2 Are :%d %d",Num1,Num2);
}
}
🚨 Interview Important Question 🚨
Java Program Swapping Of Two Numbers Without Using Third Variable
*/
package ABC;
import java.util.*;
public class Main {
public static void main(String[] args) {
int Num1,Num2;
Scanner S = new Scanner(System.in);
System.out.println("Enter Value Num1:");
Num1 = S.nextInt();
System.out.println("Enter Value Num2:");
Num2 = S.nextInt();
// Condition
Num1 = Num1 + Num2;
Num2 = Num1 - Num2;
Num1 = Num1 - Num2;
// After Swapping
System.out.printf("Value Of Num1,Num2 Are :%d %d",Num1,Num2);
}
}
👍4
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
https://www.youtube.com/c/frbjava
https://www.youtube.com/c/frbjava
Once we hit 1k subscribers count on our YouTube channel. Our live streaming option will be enabled then we will start live classes as well
Hashset internally call equals() method for comparing object state
Anonymous Quiz
44%
False
56%
True
👍1
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
https://www.youtube.com/c/frbjava
https://www.youtube.com/c/frbjava
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
Many people got confused in output of above program, correct answer is
Hello1234. We will upload a video on our YouTube channel to explain this concept
Hello1234. We will upload a video on our YouTube channel to explain this concept
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
Many people have recently Joined our group they can also subscribe to our channel to learn programming
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
👍3
Thanks Everyone for your support we have crossed 400 subscribers in just one month.
If you have not yet subscribed to our channel.
Please subscribe https://www.youtube.com/c/FrbJava
If you have not yet subscribed to our channel.
Please subscribe https://www.youtube.com/c/FrbJava