Jump to content

Loops/Increment loop index within loop body: Difference between revisions

m
→‎{{header|R}}: Syntax highlighting.
No edit summary
m (→‎{{header|R}}: Syntax highlighting.)
Line 3,924:
=={{header|R}}==
R cannot complete this task with a for loop. See https://stackoverflow.com/a/5913329/ . Instead, we must go down the same path as the Kotlin solution. Because it is sufficient for numbers this small, we will save ourselves some work and use the gmp library's isprime function for checking if a number is prime.
<lang Rrsplus>i<-42
primeCount<-0
while(primeCount<42)
331

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.