0% found this document useful (0 votes)
11 views

Quiz 10

The document discusses operators in programming and includes examples of logical, bitwise, arithmetic, and comparison operators. Students are asked to solve problems using different operator types and reflect on what they learned about operators in programming.

Uploaded by

Meemai Narciso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Quiz 10

The document discusses operators in programming and includes examples of logical, bitwise, arithmetic, and comparison operators. Students are asked to solve problems using different operator types and reflect on what they learned about operators in programming.

Uploaded by

Meemai Narciso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DEPARTMENT OF EDUCATION

REGION X
DIVISION OF CAGAYAN DE ORO CITY
CAGAYAN DE ORO NATIONAL HIGH SCHOOL

Technology and Livelihood Education (TLE)


Creative Technologies-10

Name: ___________________________________ Date: ____________


Year and Section: __________________________ Score: ___________

PART I
Direction: Solve the following problems. In One whole sheet of paper. Copy and answer, Show your solution.

Logical operators (right 1(true) or 0 (false)only): Bitwise operators:

1. int a = 151, b = 15, c = 51, result; 1. << (left shift) Use 8 bits
printf("(a < c) && (c > b)&&(a!=b) &&(a==b)is %d \n", result); int a = 20;
Output:_______ printf("b<<3 = %d\n", b << 3);
2. int a = 18, b = 800, c = 100, result; a= 10=
printf("(a < c) || (c <b)||(a==b) ||(a<b)is %d \n", result); =
Output:_______ Result:
3.int a = 100, b = 10, c = 1, result; 2. >> (right shift) Use 8 bits
printf("!(a < c) is %d \n", result); result=
Output:_______ int a = 20;
4. int a = 11, b = 11, c = 111, result; printf("b >>2 = %d\n", b >> 2);
printf("!(a ==b) is %d \n", result); a= 10=
Output:_______ =
5. int a = 20, b = 50, c = 30, result; result=
printf("!(a > c) is %d \n", result); 3. (AND/&)
Output:_______ int a = 8, b = 4;
6. int a = 5, b = 10, result; a= 8 =
printf("(a%b) && (a > b)&&(a<b) &&(a!=b)is %d \n", result); b= 4 =
Output:_______ result=
4. (OR/|)
Assignment int a = 5, b = 3;
7. let a = 10; a= 5 =
a += 100 b= 3 =
solution: result=
5. (XOR/^)
8. Let a= 80 int a = 9, b = 5;
a-=30 a= 9 =
solution: b= 5 =

9 – 10. Comparison operators (write the letter only) result=


6. (NOT/~)
int a=30, b=40, c=30, d=10, e=50; int a = 8;
If ( __ > ___==___<_ != _) a= 8=
{
printf(“GOTCHA!”); result=
}
else ARITHMETIC OPERATORS
{ int a=10, b=15, c=16, d=2, e=23, ans;
If ( __ > ___==___<_ != _){
printf(“OH NO!”); 7. ans= a+d*b%d*b
}
8. ans= a/c+d *e/b

9. ans= b+e/b+d-b*d

10. ans= d+e-b*d

1
Part II.
REFLECTION ACTIVITY

Direction: Answer the following reflection for the Operators Lesson: Use 1 or 2 whole sheets of paper.

1. What have you learned in our discussions about operators? You may summarize it to explain your
answer. (minimum of 5 sentences)
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________

2. What Operators you feel very easy to solve? Why? (minimum of 5 sentences)
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________

3. What operators you feel very difficult to solve? Why? (minimum of 5 sentences)
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________

4. Where you able to cope with the difficult lessons (yes or no)? How? (minimum of 5 sentences)
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________

5. Do you think that all operators are very important in programming? Why? (minimum of 5 sentences)
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________

You might also like