Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following JavaScript code?
int a==2;
int b=4;
int ans=a+b;
print(ans);

What will be the output of the following JavaScript code?
int a==2;
int b=4;
int ans=a+b;
print(ans);
a) 0
b) 2
c) 6
d) error

Answer: d
Explanation: The following code will generate into an error output as a comparator operator is used outside of if statement. A single equalto (’=’) operator is used for initialization.

Join The Discussion