How create a function to resolve binomial to n-power?

Hi community! I need u help, i have an exercise, calcule a binomial to n-power, it is like this:

Total= (1 + 0.01)^ N

I have written:

exercise <- function(N){
total <- (1 + 0.01)^N

But, it doesn't work :frowning: I'm a beginner, please help me to find the error.

Welcome to the community!

What do you mean it doesn't work? If you run exercise(10) on console after defining as it is, does it fail for you?

As far as I can tell, your question doesn't violate homework policy of this community. But still, please be familiar with it.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.