0% found this document useful (0 votes)
4 views1 page

Practice Exercise: Operators & Control Structures

Uploaded by

huhaygagokaba
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)
4 views1 page

Practice Exercise: Operators & Control Structures

Uploaded by

huhaygagokaba
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

This problem will serve as your practice exercise for our upcoming Laboratory Activity next week.

The purpose of this task is to help you prepare and make sure you understand our topic on
operators and control structures.

Task:

• Write a program that asks the user to enter two numbers and then choose an operation:

1. Addition

2. Subtraction

3. Multiplication

• Use the proper operators (+, -, *) to perform the calculation.

• Use a control structure (switch) to execute the operation based on the user’s choice.

• Display the result properly.

Sample Output:

Enter first number: 8

Enter second number: 5

Choose operation:

1. Addition

2. Subtraction

3. Multiplication

Enter choice (1-3): 1

The result of Addition is: 13

Important Reminder:
If you cannot solve this practice problem, it means you have not fully understood the lesson.
Therefore, you will have no chance of successfully answering the Laboratory Activity next week,
since it will be based on the same topic. You may use online coding platforms or mobile apps such
as SoloLearn or Coding C to write, run, and test your program.

Make sure you give your best effort in answering this practice problem to get ready for the lab
activity.

See you next week at the Laboratory. May the odds be ever in your favor!

You might also like