Question

In C++, the modulus operator, %, takes any numeric operands. (True or False)

In C++, the modulus operator, %, takes any numeric operands. (True or False)

Homework Answers

Answer #1

Yes.. it's true that modules operator take integers.

For example : x% y

1. If y is divided by x, then result is 0.

2. If y is not divisible bt x, then reminder will be in range of (1, x-1)

3. If x is 0 then it leads to division by zero

Note that

1. % operator is not applied to floating or double numbers which leads to compiler error.

2. For negative integers, it's based on machine independent.. some compiler gives result as 1 for negative and some gives as -1 for negative

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1. State whether each of the following is true or false. If false explain why. a....
1. State whether each of the following is true or false. If false explain why. a. The escape sequence \n, when output with cout and the stream insertion operator (<<), causes the cursor to position to the beginning of the next line on the screen. b. All the variables must be given a type when they are declared. c. Declarations can appear almost anywhere in the body of a C++ program. d. The modulus operator(%) can be used only with...
Java: All Hail Modulus Agustus! The modulus operator is used all the time. Realize that if...
Java: All Hail Modulus Agustus! The modulus operator is used all the time. Realize that if you “mod” any number by a number “n”, you’ll get back a number between 0 and n-1. For example, “modding” any number by 20 will always give you a number between 0-19. Your job is to design implement (source code) a program to sum the total of all digits in an input integer number between 0 and 1000, inclusive. Notice that you need to...
THE CLAIM OF ANY HYPOTHESIS TEST IS ALWAYS Ha. THIS IS A TRUE-FALSE QUESTION. A. TRUE...
THE CLAIM OF ANY HYPOTHESIS TEST IS ALWAYS Ha. THIS IS A TRUE-FALSE QUESTION. A. TRUE B. FALSE.
Is the following TRUE or FALSE? If any of the problem is FALSE, explain why. 1....
Is the following TRUE or FALSE? If any of the problem is FALSE, explain why. 1. Purchases and sales of securities are always reported as financing activities in a statement of cash flows. TRUE or FALSE 2. Unrealized gains and losses are never included in other comprehensive income for securities that are classified as available for sale. TRUE or FALSE 3. If an investment is accounted for under the equity method, the investor increases investment income and the investment account...
The time it takes for a data collection operator to fill out an electronic form for...
The time it takes for a data collection operator to fill out an electronic form for a database is uniformly distributed between 7.5 and 14 minutes. a. What is the mean time it takes to process an electronic form? b. What is the standard deviation of the time it takes to process an electronic form? c. What is the probability that it takes more than 10 minutes to fill out a form? d. What is the probability it takes between...
TRUE OR FALSE? In accepting an engagement letter,an auditor takes responsibilities to the public,the client,and other...
TRUE OR FALSE? In accepting an engagement letter,an auditor takes responsibilities to the public,the client,and other members of the profession?
2.7 (a) True or false: P(A|B) + P(A|Bc)=1. Either show it true for any event A...
2.7 (a) True or false: P(A|B) + P(A|Bc)=1. Either show it true for any event A and B or exhibit a counter-example. (b) True or false: P(A|B) + P(Ac|B)=1. Either show it true for any event A and B or exhibit a counter-example.
A student takes an 8-question, true-false exam and guesses on each question. Find the probability of...
A student takes an 8-question, true-false exam and guesses on each question. Find the probability of passing if the lowest passing grade is 6 correct out of 8. a. 0.109 b. 0.227 c. 0.144 d. 0.164
A student takes an exam containing 11 true or false questions if the student guesses what...
A student takes an exam containing 11 true or false questions if the student guesses what is the probability that he will get less than six but more than three questions right
A student takes an exam containing 13 true or false questions. If the student guesses, what...
A student takes an exam containing 13 true or false questions. If the student guesses, what is the probability that he will get exactly 2 questions right? Round your answer to four decimal places.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT