TCS Company Programming Output

What will be the output?

public class Main
{
public static int main(String args[])
{
int x = 10;
int y = 10;
if (x^y)
System.out.println(" x is equal to y ");
return 0;
}
}

A. Nothing will print
B. Compile time error
C. x is equal to y
D. Runtime Error​

Read Solution (Total 5)

TCS Other Question

In a hexagon shaped park some trees are to be planted such that each corner has a tree and equal number of trees should be on each side. How many trees would be needed if each side must have six trees?

A. 36
B. 32
C. 34
D. 30
Which of the following function is used to accept string with white spaces?

A. getStrings();
B. getWhiteSpaceString();
C. scanf();
D. gets();