Discover a world of knowledge at Westonci.ca, where experts and enthusiasts come together to answer your questions. Connect with professionals on our platform to receive accurate answers to your questions quickly and efficiently. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.

1. Is the function void or return
a. void
b. return
2. What is the result of the following expression: int r = 3; r%2 == 0;
a. it evaluates as true
b. it evaluates as false
c. nothing happens


Sagot :

Answer:

(a) void

(b) Nothing happens

Explanation:

Solving (a): void and return

A function that returns no value is referred to as a void function.

On the other hand, a void can not be return or named return.

So, the function is void

Solving (b):

r = 3

Required

The result of r%2 == 0

Substitute 3 for r in r%2 == 0

3%2 == 0

3%2 is 1.

So, we have:

1 == 0

Hence, the equivalent of r%2 == 0 is 1 == 0.

However, nothing will happen because there is no instruction attached to the statement (i.e. r%2 == 0;)

Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. We're glad you visited Westonci.ca. Return anytime for updated answers from our knowledgeable team.