Computer Science, asked by ivaanthomas34, 8 months ago

1. What arithmetic operators cannot be used with strings?
a) + 'a'+'b'
b) *
c) -
d) All of the mentioned​

Answers

Answered by aryansuts01
0

Answer:

Concept:

The four basic operations in arithmetic are addition, subtraction, multiplication, and division. However, arithmetic also covers more complex operations like manipulating percents, real numbers, exponents, logarithmic functions, and even trigonometric, which are similar to logarithms. Expressions in mathematics must be evaluated in accordance with the planned order of operations. A prefix or postfix notation, which separately fix the order of execution, is another option. The most prevalent method is to use infix writing with parentheses expressly and in accordance with priority criteria. A field is any collection of objects on which all four mathematical operations may be done and where these four operations follow the rules.

Given:

What arithmetic operators cannot be used with strings?

a) + 'a'+'b'

b) *

c) -

d) All of the mentioned​

Find:

Locate the appropriate response to the given question.

Answer:

The correct answer is option (c)

Strings are multiplied by * and concatenated with +.

  • Calculations in mathematics are done using arithmetic operators. The sum of two numbers are provided by this operator. Basic
  • arithmetic operator for addition; an arithmetic operator typically produces a numeric value as a result.
  • If an expression contains many operations, each one is evaluated and resolved in a specific order known as Operator Precedence.

#SPJ2

Answered by gayatrikumari99sl
3

Answer:

Option(c) '-', arithmetic operators cannot be used with strings.

Explanation:

  • The symbols used to represent arithmetic math operations are called arithmetic operators.
  • Examples  + (for addition), - (subtraction), * (multiplication), and / (division operator).
  • A string is a programming data type that is similar to an integer and a floating point unit, except it represents text instead of numbers.
  • It is made up of a series of symbols that may also include spaces and numerals.
  • Arithmetic operators + is used  with strings to concatenate.
  • Arithmetic operator * is used  with strings to multiply strings.

Hence, arithmetic operator'-' cannot be used with strings.

#SPJ6

Similar questions