Advertisements
Advertisements
प्रश्न
Write short notes on the Arithmetic operator with examples.
संक्षेप में उत्तर
Advertisements
उत्तर
- An arithmetic operator is a mathematical operator that takes two operands and performs a calculation on them.
- They are used for simple arithmetic.
- Most computer languages contain a set of such operators that can be used within equations to perform different types of sequential calculations.
- Python supports the following Arithmetic operators.
| Operator-Operation | Examples | Result |
| Assume a=100 and b=10 Evaluate the following expressions | ||
| + (Addition) | > > > a+b | 110 |
| – (Subtraction) | > > > a-b | 90 |
| * (Multiplication) | > > > a*b | 1000 |
| / (Division) | > > > a/b | 10.0 |
| % (Modulus) | > > > a% 30 | 10 |
| ** (Exponent) | > > > a**2 | 10000 |
| / / (Floor Division) | > > > a// 30 (Integer Division) | 3 |
shaalaa.com
Tokens
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
APPEARS IN
संबंधित प्रश्न
Which of the following is not a token?
Which operator is also called a Comparative operator?
Which of the following is not a logical operator?
What is a literal?
Explain the types of literals?
What are the assignment operators that can be used in Python?
What are string literals? Explain.
Discuss in detail Tokens in Python.
Which of the following is a valid java keyword?
Consider the following program segment in which the statements are jumbled, choose the correct order of statements to swap two variables using the third variable.
void swap(int a, int b)
{ a=b; -> (1)
b=t; -> (2)
int t=0; -> (3)
t=a; -> (4)
}
