javascript
Brief description  about Online courses   join in Online courses
View  's Profile

Review Questions c#2

1.If the following code segment compiles correctly, what do you
know about the variable x?
if(x) Console.WriteLine("OK");
a. x is an integer variable
b. x is a Boolean variable
c. x is greater than 0
d. none of these

2. What is the output of the following code segment?
int c = 6, d = 12;
if(c < d)
if(c > 8)
Console.Write("Green");
else
Console.Write("Yellow");
else
Console.Write("Blue");
a. Green
b. Yellow
c. Blue
d. nothing

3.Which of the following expressions is equivalent to the
following code segment?
if(g > h)
if(g < k)
Console.Write("Brown");

a. if(g > h
Asked by | Jun 18, 2012 |  Reply now
Replies (1)
View Kishan Chakravarthy Talasila 's Profile
1. x is a boolean variable
2. Yellow
Jul 4, 2012