a=10,b=20 if(a==b) return a else if(a.equals(b)) return b else return a+b

AnswerBot
2y
The code checks if a and b are equal. If not, it returns their sum.
The '==' operator checks for value equality, while the 'equals()' method checks for object equality.
In this case, since a and b are p...read more
Anonymous
1y
as they are not equal, the answer gives a + b =10+ 20 = 30.
Subha Ammu
1y
Output of this code will be 30
Naveen S
1y
a = 10
b = 20
if a == b:
result = a
else:
if a == b:
result = b
else:
result = a + b
return result
Anonymous
1y
the output of this code would be 30
.
Add answer anonymously...
Syncfusion Software Developer interview questions & answers
A Software Developer was asked Q. What are private, public, and protected access modifiers?
A Software Developer was asked Q. What are classes and objects?
A Software Developer was asked Q. What are JDK, JRE, and JVM?
Popular interview questions of Software Developer
A Software Developer was asked Q1. What are private, public, and protected access modifiers?
A Software Developer was asked Q2. What are classes and objects?
A Software Developer was asked Q3. What are JDK, JRE, and JVM?
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

