Search⌘ K

Exercise 6: Arithmetic Operators

Practice solving arithmetic expressions in R and learn to use the cat function to print output effectively. This lesson helps you understand how to apply arithmetic operators correctly and display results in R, building a foundation for data manipulation tasks.

Problem Statement

Print the answer to the following equation using R language.

2 + 4 * 9 - 8

Use cat() to display your answer to the equation or the test case will not pass.

Sample Output

30

Test Yourself

Write your code in the given area. If you get stuck, you can look at the solution.

R
# Write your code here
cat(" ")