Operator Related Problems
Operator Related Problems
(Total 15 questions)
SL Problem statement Difficulty
levels
1. Program that will take two numbers X and Y as inputs, then calculate and print the values *
of their addition, subtraction, multiplication, division (quotient and reminder).
❖ -14 % 3 = -2
❖ -14 % -3 = -2
❖ 14 % -3 = 2
3. Program that will take two numbers (a, b) as inputs and compute the value of the equation *
– (Without using math.h)
5. Program that will increment and decrement a number X by Y. (Use += and -= operators) *
6. Program that will multiply and divide a number X by Y. (Use *= and /= operators) *
7. Program that will take two numbers as inputs and print the maximum value. **
9. Program that will take a, b & c as inputs and decide if the statements are True (1) of False **
(0)
a) (𝑎 + 𝑏) ≤ 80
b) ! (𝑎 + 𝑏)
c) 𝑐! = 0
10. Program that will take a, b & c as inputs and decide if the statements are True (1) of False ***
(0)
1) (𝑎 + 𝑏) ≤ 80 && 𝑐 ≥ 0
2) (𝑎 − 𝑏) == 0 | | 𝑐! = 0
3) 𝑎! = 𝑏 | | ! (𝑏 < 𝑐) && 𝑐 > 0
4) (𝑎! = 𝑏 | | ! (𝑏 < 𝑐) ) && 𝑐 > 0
11. Program that will take calculate the roots of a quadratic equation (a.x2 + b.x + c = 0) from ***
the formula, (here, dot (.) stands for multiplication) -
−𝑏 ± 𝑠𝑞𝑟𝑡(𝑏 2 − 4. 𝑎. 𝑐)
𝑟𝑜𝑜𝑡 =
2. 𝑎
𝑥
2𝑐𝑜𝑠 2 𝑥 − √3 sin 𝑥 + 𝑙𝑜𝑔
2
; where 1<= x <=180 [No checking needed]
Program that will take a floating point number X as input and evaluate A,B,C where- **
13. A = Value when X is rounded up to the nearest integer
B = Value when X is rounded down to the nearest integer
C = Absolute value of X