Arithmetic, Unary and Operators Flashcards
What is the purpose of the unary operator++in C?
Subtraction
Addition
Decrement by 1
Increment by 1
Increment by 1
What is the result of the expression 15 + 7?
8
10
57
22
22
What is the result of the expression 5 + 3 * 2?
26
13
16
11
11
Given int a = 7; int b = 3;, what does the expression a % b compute?
2.3
1
4
2
1
Given int x = 25; int y = 4;, what is the value of x / y?
29
6
4
25
6
If int x = 10;, what does the expression
- - x yield?
10
11
9
8
9
Which operator is used for finding the remainder of a division operation in C?
%
/
#
*
%
If float a = 7.5; float b = 2.5;
,what is the value of a * b?
17.5
18.75
18
17
18.75
Given int num = 8; , what does the expression num++ evaluate to?
7
9
8
10
9
How is the order of operations determined in an expression?
Right to left
Left to right
By operator precedence rules
It varies based on the compiler
By operator precedence rules