Arithmetic, Unary and Operators Flashcards

1
Q

What is the purpose of the unary operator++in C?
Subtraction
Addition
Decrement by 1
Increment by 1

A

Increment by 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the result of the expression 15 + 7?
8
10
57
22

A

22

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the result of the expression 5 + 3 * 2?
26
13
16
11

A

11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Given int a = 7; int b = 3;, what does the expression a % b compute?
2.3
1
4
2

A

1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Given int x = 25; int y = 4;, what is the value of x / y?
29
6
4
25

A

6

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

If int x = 10;, what does the expression
- - x yield?
10
11
9
8

A

9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which operator is used for finding the remainder of a division operation in C?
%
/
#
*

A

%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If float a = 7.5; float b = 2.5;
,what is the value of a * b?
17.5
18.75
18
17

A

18.75

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Given int num = 8; , what does the expression num++ evaluate to?
7
9
8
10

A

9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

By operator precedence rules

How well did you know this?
1
Not at all
2
3
4
5
Perfectly