1. Engineering
  2. Computer Science
  3. question 6 not yet answered marked out of 100 flag...

Question: question 6 not yet answered marked out of 100 flag...

Question details

Question 6

Not yet answered
Marked out of 1.00
Flag question

Question text

Which one of the following is the not equal operator?
a.
<>
b.
!=
c.
NOT
d.
*&

Question 7

Not yet answered
Marked out of 1.00
Flag question

Question text

1. What will be the values of ans, x, and y after the following statements are executed?
int ans = 35, x = 50, y =50;
if ( x >= y)
{  
ans = x + 10;   x -=y;
}
else
{  
ans = y + 10;  
y += x;
}
a.
ans = 60, x = 50, y =100
b.
ans = 60, x =0, y =50
c.
ans = 45, x = 50, y = 0
d.
ans = 45, x = 50, y = 50

Question 8

Not yet answered
Marked out of 1.00
Flag question

Question text

What will be the value of x after the following code is executed? 
int x = 10;
while (x < 100)
{
   x += 10;
}
a.
90
b.
100
c.
110
d.
This is an infinite loop.

Question 9

Not yet answered
Marked out of 1.00
Flag question

Question text

Assuming that str is declared as follows:
String str = "PSTUVWXYM"; 
What value will be returned from str.charAt(5)?
a.
U
b.
V
c.
W
d.
X

Question 10

Not yet answered
Marked out of 1.00
Flag question

Question text

What would be the results of the following code?
final int SIZE = 25;
int[] array1 = new int[SIZE];… // Code that will put values in array1
int value = 0;
for (int a = 0; a < array1.length; a++)
{  
value += array1[a];
}
a.
Value contains the highest value in array1.
b.
Value contains the lowest value in array1.
c.
Value contains the sum of all the values in array1.
d.
This would cause the program to crash.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution