1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nikdorinn [45]
3 years ago
14

If num is an int which expression always evaluates to true if num holds an odd number

Computers and Technology
1 answer:
tatyana61 [14]3 years ago
8 0

The answer is 2) Num%2==1.
The modulus operator (%) divides the left hand side by the right hand side and returns the remainder.

Examples:
3%2=1 : 2 goes into 3 once, with 1 remaining.

5%2 =1 :  2 goes into 5 twice, with 1 remaining.

11%2 =1 :  2 goes into 11 five times, with 1 remaining.

You might be interested in
A peripheral can be used to tell a computer to complete a specific task.<br> A) True <br> B)False
RoseWind [281]

Answer:

A. true

Explanation:

<em><u>because</u></em><em><u> </u></em><em><u>you</u></em><em><u> </u></em><em><u>can</u></em><em><u> </u></em><em><u>complete</u></em><em><u> </u></em><em><u>it</u></em><em><u> </u></em><em><u>without it</u></em><em><u> </u></em><em><u>mistakes</u></em><em><u> </u></em><em><u>if</u></em><em><u> </u></em><em><u>your</u></em><em><u> </u></em><em><u>using</u></em><em><u> </u></em><em><u>an</u></em><em><u> </u></em><em><u>computer</u></em><em><u> </u></em><em><u>but</u></em><em><u> </u></em><em><u>if</u></em><em><u> </u></em><em><u>you</u></em><em><u> </u></em><em><u>use</u></em><em><u> </u></em><em><u>an</u></em><em><u> </u></em><em><u>paper</u></em><em><u> </u></em><em><u>you</u></em><em><u> </u></em><em><u>will</u></em><em><u> </u></em><em><u>make</u></em><em><u> </u></em><em><u>mistakes</u></em><em><u> </u></em><em><u>over</u></em><em><u> </u></em><em><u>and</u></em><em><u> </u></em><em><u>over</u></em>

8 0
2 years ago
An organization’s IRP prioritizes containment over eradication. An incident has been discovered where an attacker outside of the
emmasim [6.3K]

Answer:

The correct answer is (a) Remove the affected servers from the network.

Explanation:

Solution:

Now, since the organisation top priority is more of  containment over eradication, an outbreak code that is hostile as an can be suppressed effectively by removing the web server completely from the over all network facilities or infrastructure.

Also, if the affected servers are not removed, it might affect the integrity, confidentiality of sensitive materials or documents which will be exposed to the outside world by the attacker.

4 0
3 years ago
1 #include 2 3 int max2(int x, int y) { 4 int result = y; 5 if (x &gt; y) { 6 result = x; 7 } 8 return result; 9 } 10 11 int max
Serhud [2]

Answer:

7

Explanation:

#include <stdio.h>

int max2(int x, int y) {

   int result = y;

   if (x > y) {

       result = x;

   }

   return result;

}

int max3(int x, int y, int z) {

   return max2(max2(x,y),z);

}

int main() {

   int a = 5, b = 7, c = 3;

   printf("%d",max3(a, b, c));

   printf("");

   return 0;

}

Hi, first of all, next time you post the question, it would be nice to copy and paste like above. This will help us to read the code easily. Thanks for your cooperation.

We start from the main function:

The variables are initialized → a = 5, b = 7, c = 3

max3 function is called with previous variables and the result is printed → printf("%d",max3(a, b, c));

We go to the max3 function:

It takes 3 integers as parameters and returns the result of → max2(max2(x,y),z)

Note that max2 function is called two times here (One call is in another call actually. That is why we need to first evaluate the inner one and use the result of that as first parameter for the outer call)

We go to the max2 function:

It takes 2 integers as parameters. If the first one is greater than the second one, it returns first one. Otherwise, it returns the second one.

First we deal with the inner call. max2(x,y) is max2(5,7) and the it returns 7.

Now, we need to take care the outer call max2(7, z) is max2(7, 3) and it returns 7 again.

Thus, the program prints 7.

6 0
2 years ago
What is the output of the following code segment?
Aliun [14]

Answer:

o

Explanation:

8 0
2 years ago
What is displayed on the console when running the following program?
Andre45 [30]

Answer:

The answer is "Option A"

Explanation:

In the given java code, a class "Test" is defined, inside the main method try and catch block is used, inside the try block method "p()" is called, that print a message. in this block two catch block is used, that works on "NumberFormatException" and "RuntimeException".  In the method "p" declaration, a string variable "s" is defined, that holds double value, that is "5.6", and converts its value into the wrong integer, and other wrong option can be described as follows:

  • In option B, it is wrong, it is not followed by after call method.
  • In option C, It is not followed by runtime exception, that's why it is incorrect.
  • Option D and Option E both were wrong because they can't give run time and compile-time error.  
6 0
3 years ago
Other questions:
  • What is the purpose of copyfitting?
    12·1 answer
  • What are the two types of lighting?
    7·2 answers
  • Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than
    9·1 answer
  • You want to divide the value in cell D3 by the value in cell E3. Which formula should you use?
    11·2 answers
  • In paragraph form, explain and describe at least three common situations in which you would yield the right-of-way.
    5·1 answer
  • AYUDAAAA!!!!! URGENTE!!!!!!1<br> ¿para que sirve la "BIG DATA"?
    9·1 answer
  • Help me please I’m failing
    11·1 answer
  • Repeated execution of a set of programming statements is called repetitive execution.
    7·1 answer
  • Write an algorithm to verify a number as even​
    9·1 answer
  • Which item can be added to Outlook messages, like a Word document or PowerPoint presentation, that takes standard bulleted lists
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!