Error unexpected in

0 votes
factor <- function(n){
print(paste("the factors of ",n,"are:"))
for(i in 1:n) {
if((n%i)==0) {
  print(i)
}
}
}
Apr 25, 2020 in Others by anirudh
• 120 points
144 views

1 answer to this question.

0 votes

Hey, @Anirudh,

Regarding your query, the if statement would need enclosing {} symbols.

This is a syntax error: Enclose your if in curly braces.

I hope this will work.

answered Apr 27, 2020 by Gitika
• 65,870 points

Related Questions In Others

0 votes
1 answer

Using unserialize in PHP throws the same error repeatedly

I googled 'Node no longer exists', and ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,240 points
536 views
+1 vote
1 answer

what is the difference between error and stderr in Node.js?

Error is an object created by Node.js to handle ...READ MORE

answered Jul 4, 2019 in Others by sunshine
• 1,280 points
489 views
0 votes
1 answer

Error cannot provide both a color and a decoration in Flutter container.

Hi@akhtar, The color and decoration arguments cannot both be supplied, since it ...READ MORE

answered Jul 29, 2020 in Others by MD
• 95,140 points
703 views
0 votes
1 answer

ERROR: You need elevated Administrator privileges in order to run this script.

Hi@akhtar, I guess you are trying to run ...READ MORE

answered Sep 8, 2020 in Others by MD
• 95,140 points
104 views
0 votes
0 answers
0 votes
1 answer

Reducing sequences in an array of strings

I've written a C# app to solves ...READ MORE

answered Nov 2, 2018 in Others by DataKing99
• 8,240 points
150 views
0 votes
1 answer

Avoiding memory leaks in C++

If you use smart pointers at all ...READ MORE

answered Nov 5, 2018 in Others by nirvana
• 3,150 points
665 views
0 votes
1 answer

Error: IllegalArgumentException: Unable to locate adb in Android Studio v2.3

when you try to move an Android project ...READ MORE

answered Dec 16, 2020 in Others by Gitika
• 65,870 points
1,294 views