Sunday, 21 October 2018

Lab 5 : Switch statement, Logical Operator and Conditional Operator

Hi everyone! Today is my Lab 5 work. Let's see what I do in this class.
For this topic, we learn how to use switch statement to specify alternative paths of program's execution. Besides, we learn how to use logical operators to combine Boolean expressions and lastly we learn to use conditional operators for concise and elegant code for decision making.

For me, this chapter is quite confusing because it has many statement that we need to executed. But when I do the exercise, I can understand how the process going on. Here is our exercise for Lab 5 today.

Question 1


Answer :


Question 2



Answer :


Flowchart :


Question 3


Answer :


Question 4


Answer : 


Question 5 



Answer :



Question 6 :


Answer :



Question 7


Answer :






Question 8



Answer :





Question 9


Answer :




That's all from me. Thank you for reading my blog. Till we meet again !

Next blog : saiful21ikhwan.blogspot.com

No comments:

Post a Comment

Lab 10

Hello everyone! Now is our Lab 10 exercise. For this topic, we learn  Multi-Dimensional Array and having lab for this sub-topic. We learn ho...