Arithmetic Operators Practice

By: Nicole Zolnier, Matthew Gibbons

A fun thing to do in these exercises is to create a separate function and call it in main. That way, you can have your own library of functions and reuse it if you need.

  1. Write a function that takes 5 numbers and returns the sum and average (in two decimal places) of them.

  2. Write a function that receives a number and returns whether it is even or odd.

  3. Write a function that receives a number and returns if the number is divisible by 3.

  4. Write a function that takes two numbers and returns which one is higher.

  5. Write a function that takes three numbers, the sides of a triangle and returns whether the triangle formed by the given sides is equilateral, isosceles, or scalene.

  6. Assign this expression to a float. You can do this in a single line without writing a main function.

2x+7y13372+z\frac{2x+7y-13}{37^2+z}

  1. Multiply an integer by 8, another integer by 32, and divide a third integer by 4, all using bitwise operators. You do not need to write a main function.