Uploaded by Jericho Faderagao

Activity 4.2 c language operator

advertisement
Faderagao, Jericho F.
2CE-1
March 16, 2023
Activity 4.2
C Language Operator
1. Let a, b, c be integer variables having values 2, 4, 5 respectively and x, y, z be float
variables having values 1.1, 2.5, 3.6 respectively. Determine the value of each
arithmetic statements.

a+b+c
11

a%b
2

a/b
0.5 but zero as they are declared interger.
 a* (b / c )
0 // b/c = 0
 x + y +z
7.2
 x/(y+z)
 x%y
0.180328 // they are declared as float
invalid as module operator do not work
on float variables
2. Determine the value of each statement by writing True or False. Let integer x = 2,
y=5, z = 10
=true && false false
 (x<y) && ( y >=z) || ( z == x)
=true && false
= false
=0
 (y > x = x)||! ( z ==10 )&& (x < z
&&y == 2 || z > y)
= true || false && true
= true false
= true
=1
 ( z % y == x) && ( ( y + z) / 3 >=x
= false && true
= false
=0
Download