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
Gwar [14]
3 years ago
8

Which of the following is true regarding the mod operator, %? Group of answer choices It can only be performed on int values and

its result is a double It can only be performed on int values and its result is an int It can only be performed on float or double values and its result is an int It can only be performed on float or double values and its result is a double It can be performed on any numeric values, and the result always is numeric
Computers and Technology
2 answers:
Paul [167]3 years ago
6 0

Answer:

It can only be performed on numeric values and its result is a numeric.

Explanation:

If a is an integer and n is a positive integer, we define a mod n to be the remainder when a is divided by n . The integer n is called the modulus and the operation is called Modulo operation. It is written as:

a mod n = a % n

The result of the above operation is always a numeric value.

The last option is correct because numeric value covers integer, float and double. The result of a modulo operation is numeric.

The last option is the generalization of the previous options.

aleksandrvk [35]3 years ago
5 0

Answer:

It can be performed on any numeric values, and the result is always numeric.

Explanation:

The mod operator (usually represented by %) is an arithmetic operator that is used to return the remainder when a number is divided by another number. These numbers can either be a double, an integer or a float. In other words, the mod operator will act on any numeric values and the result will be numeric.

For example;

(i) 5 % 2 = 1

i.e when 5 is divided by 2, the remainder is 1.

(ii) 5.2 % 3 = 2.2

i.e when 5.2 is divided by 3, the remainder is 2.2

<em>Hope this helps!</em>

<em />

You might be interested in
Device managment is the process of managing what kind of devices​
prisoha [69]

Mobile device management is a type of security software used by an IT department to monitor, manage, and secure employees' mobile devices (laptops, smartphones, tablets, etc.) that are deployed across multiple mobile service providers and across multiple mobile operating systems being used in the organization.

6 0
3 years ago
write a program that generates 100 random integrs between 0 and 9 and displays the count for each number. (Hint: Use (int) (math
Nataly_w [17]

Answer: The java program to generate 100 random numbers and count their occurrence is shown below.

import java.util.Random;

import java.util.*;

public class MyClass {

   public static void main(String args[]) {

     int[]count = new int[10];

// temporarily stores the randomly generated number

     int num;

     for(int i=0; i<10; i++)

     {

// initialize count of all digits from 0 to 9 to zero

           count[i] = 0;

     }

     for(int i=0; i<100; i++)

     {

// generates 100 random numbers or integers from 0 through 9

           num = (int) (Math.random() * 10);

           for(int j=0; j<10; j++)

           {

// compare each randomly generated number with digits from 0 to 9 and increment their count accordingly

               if(num == j)

                   count[j] = count[j]+1;

           }

     }

     System.out.println("The count of randomly generated numbers is shown below.");

     for(int i=0; i<10; i++)

     {

           System.out.println("Count of "+i+" is "+ count[i]);

     }

   }

}

OUTPUT

The count of randomly generated numbers is shown below.

Count of 0 is 10

Count of 1 is 8

Count of 2 is 13

Count of 3 is 10

Count of 4 is 9

Count of 5 is 13

Count of 6 is 7

Count of 7 is 11

Count of 8 is 9

Count of 9 is 10

Explanation: This program declares an integer array of size 10 and initializes it to 0.

Random numbers are generated as shown. The number is randomly generated in an outer for loop with executes 100 times for 100 numbers.

(int) (Math.random() * 10)

The package java.util.Math is imported to serve the purpose.

The above code generates random numbers which can be floating numbers. The integer part is extracted using (int).

This yields the digits from 0 through 9.

For every occurrence of digits from 0 to 9, the count of the index of the respective digit is incremented.

To serve this purpose, inner for loop is implemented. The variable used in this loop is compared with the random number and index of count incremented accordingly. The inner for loop runs 10 times at the maximum, in order to match random number with 0 through 9.

Lastly, the occurrence of every digit from 0 to 9 is displayed.

8 0
4 years ago
On a cost-per-thousand (CPM) basis, the cost of Web ads for the most part_______
Viefleur [7K]

Answer: c)compares favorably with ads placed in traditional media.

Explanation:

CPM(cost-per-thousand) is basically defined as the one web page that has cost 1000 advertisements in the marketing world. Web ads or advertisements are the online marketing strategy that is also known as online advertising. So, according to the CPM,web ads have a main focus on the comparison with the traditional media as they advertise through the traditional ways such as radio , printing etc.So, there is a sort of competition in both the methods for advertising.

6 0
3 years ago
Answer to correct answer to numb 21
Varvara68 [4.7K]

*$M$3/4

this is answered first

4 0
3 years ago
Read 2 more answers
Write a line of code to output the following message: Welcome to Computer Science
Bingel [31]
OK I need more info it is not anfo imfo for me to answer the question so I guess good bye
4 0
3 years ago
Read 2 more answers
Other questions:
  • Gettier contributed to what we know about the __________ model, while Rosch contributed to what we know about the __________ mod
    12·2 answers
  • The _______________ layer of the TCP/IP protocol suite is responsible for making sure that what leaves one end of the network ar
    9·1 answer
  • Which group on the sparkline tools design tab would you choose if you wanted to change the data source of the sparkline? (1 poin
    10·1 answer
  • NEED HELP PLEASE-
    7·2 answers
  • How does a cat get out of a bush?
    7·1 answer
  • What is the most common example of a magnetic storage medium in a personal computer
    5·1 answer
  • Write a program that inputs a time from the console. The time should be in the format "HH:MM AM" or "HH:MM PM". Hours may be one
    6·1 answer
  • About how long did it take to photograph Daguerre's photograph of the street?
    7·1 answer
  • Choose the type of collection described.
    9·1 answer
  • How would you assign roles to your group members?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!